Skip to content

Commit 0b2ff3d

Browse files
Joanna Jometa-codesync[bot]
authored andcommitted
Change from size_t to uint64_t
Summary: Changing from size_t to uint64_t in WebTransport f/c related constructs for type safety/consistency. Reviewed By: hanidamlaj Differential Revision: D85719537 fbshipit-source-id: b0681cb50abd5075f75c2b33265713a73dbcdd9b
1 parent 265bb87 commit 0b2ff3d

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

proxygen/lib/http/session/HQSession.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <proxygen/lib/http/session/QuicProtocolInfo.h>
3333
#include <proxygen/lib/http/session/ServerPushLifecycle.h>
3434
#include <proxygen/lib/utils/ConditionalGate.h>
35+
#include <quic/QuicConstants.h>
3536
#include <quic/api/QuicSocket.h>
3637
#include <quic/common/BufUtil.h>
3738
#include <quic/common/events/FollyQuicEventBase.h>
@@ -1845,7 +1846,7 @@ class HQSession
18451846
folly::Expected<folly::Unit, WebTransport::ErrorCode> sendDatagram(
18461847
std::unique_ptr<folly::IOBuf> datagram) override;
18471848

1848-
size_t getWTInitialSendWindow() const override {
1849+
uint64_t getWTInitialSendWindow() const override {
18491850
return session_.wtInitialSendWindow_;
18501851
}
18511852

@@ -2005,10 +2006,10 @@ class HQSession
20052006
{SettingsId::MAX_HEADER_LIST_SIZE, hq::kDefaultEgressMaxHeaderListSize},
20062007
{SettingsId::_HQ_QPACK_BLOCKED_STREAMS,
20072008
hq::kDefaultEgressQpackBlockedStream},
2008-
{SettingsId::WT_INITIAL_MAX_DATA, std::numeric_limits<size_t>::max()},
2009+
{SettingsId::WT_INITIAL_MAX_DATA, quic::kMaxVarInt},
20092010
};
20102011
HTTPSettings ingressSettings_;
2011-
size_t wtInitialSendWindow_{std::numeric_limits<size_t>::max()};
2012+
uint64_t wtInitialSendWindow_{quic::kMaxVarInt};
20122013
// Maximum Stream/Push ID that we are allowed to open, from GOAWAY
20132014
quic::StreamId peerMinUnseenId_{hq::kMaxClientBidiStreamId};
20142015
uint64_t minUnseenIncomingPushId_{0};

proxygen/lib/http/webtransport/WebTransportImpl.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <proxygen/lib/http/codec/HTTPCodec.h>
1212
#include <proxygen/lib/http/webtransport/FlowController.h>
1313
#include <proxygen/lib/http/webtransport/WebTransport.h>
14+
#include <quic/QuicConstants.h>
1415

1516
namespace {
1617
constexpr uint64_t kDefaultWTReceiveWindow = 1'048'576;
@@ -94,8 +95,8 @@ class WebTransportImpl : public WebTransport {
9495

9596
virtual bool usesEncodedApplicationErrorCodes() = 0;
9697

97-
virtual size_t getWTInitialSendWindow() const {
98-
return std::numeric_limits<size_t>::max();
98+
virtual uint64_t getWTInitialSendWindow() const {
99+
return quic::kMaxVarInt;
99100
}
100101
};
101102

@@ -341,13 +342,13 @@ class WebTransportImpl : public WebTransport {
341342
WTIngressStreamMap wtIngressStreams_;
342343
// Initialize flow controllers with max value for backward compatibility and
343344
// to ensure no functional change yet.
344-
FlowController sendFlowController_{std::numeric_limits<size_t>::max()};
345-
FlowController recvFlowController_{std::numeric_limits<size_t>::max()};
345+
FlowController sendFlowController_{quic::kMaxVarInt};
346+
FlowController recvFlowController_{quic::kMaxVarInt};
346347
folly::Optional<uint32_t> sessionCloseError_;
347348
uint64_t bytesRead_{};
348349

349350
struct StreamFlowControl {
350-
uint64_t maxStreamID{std::numeric_limits<uint64_t>::max()};
351+
uint64_t maxStreamID{quic::kMaxVarInt};
351352
uint64_t numClosedStreams{};
352353
uint64_t targetConcurrentStreams{kDefaultTargetConcurrentStreams};
353354
};
@@ -403,9 +404,8 @@ class WebTransportImpl : public WebTransport {
403404
return (id & 0b10) == 0;
404405
}
405406

406-
void setFlowControlLimits(
407-
size_t sendWindow = std::numeric_limits<size_t>::max(),
408-
size_t recvWindow = std::numeric_limits<size_t>::max()) {
407+
void setFlowControlLimits(uint64_t sendWindow = quic::kMaxVarInt,
408+
uint64_t recvWindow = quic::kMaxVarInt) {
409409
sendFlowController_ = FlowController(sendWindow);
410410
recvFlowController_ = FlowController(recvWindow);
411411
}

0 commit comments

Comments
 (0)