diff --git a/quic/api/QuicPacketScheduler.cpp b/quic/api/QuicPacketScheduler.cpp index 3df19e991..7bf34dabe 100644 --- a/quic/api/QuicPacketScheduler.cpp +++ b/quic/api/QuicPacketScheduler.cpp @@ -805,9 +805,9 @@ folly::Expected DatagramFrameScheduler::writeDatagramFrames( if (datagramLenSize.hasError()) { return folly::makeUnexpected(datagramLenSize.error()); } - auto datagramFrameLength = + uint64_t datagramFrameLength = frameTypeSize.value() + len + datagramLenSize.value(); - if (folly::to(datagramFrameLength) <= spaceLeft) { + if (datagramFrameLength <= spaceLeft) { auto datagramFrame = DatagramFrame(len, payload.move()); auto res = writeFrame(datagramFrame, builder); if (res.hasError()) { @@ -914,8 +914,7 @@ CryptoStreamScheduler::CryptoStreamScheduler( folly::Expected CryptoStreamScheduler::writeCryptoData( PacketBuilderInterface& builder) { bool cryptoDataWritten = false; - uint64_t writableData = - folly::to(cryptoStream_.pendingWrites.chainLength()); + uint64_t writableData = cryptoStream_.pendingWrites.chainLength(); // We use the crypto scheduler to reschedule the retransmissions of the // crypto streams so that we know that retransmissions of the crypto data // will always take precedence over the crypto data. diff --git a/quic/api/QuicStreamAsyncTransport.cpp b/quic/api/QuicStreamAsyncTransport.cpp index 81facfd30..bc48d9df9 100644 --- a/quic/api/QuicStreamAsyncTransport.cpp +++ b/quic/api/QuicStreamAsyncTransport.cpp @@ -410,7 +410,7 @@ void QuicStreamAsyncTransport::send(uint64_t maxToSend) { // overkill until there are delivery cbs folly::DelayedDestruction::DestructorGuard dg(this); uint64_t toSend = - std::min(maxToSend, folly::to(writeBuf_.chainLength())); + std::min(maxToSend, static_cast(writeBuf_.chainLength())); uint64_t sentOffset = streamWriteOffset_ + toSend; bool writeEOF = diff --git a/quic/api/QuicTransportFunctions.cpp b/quic/api/QuicTransportFunctions.cpp index 1b6d4b7aa..bf8f2cdb8 100644 --- a/quic/api/QuicTransportFunctions.cpp +++ b/quic/api/QuicTransportFunctions.cpp @@ -487,7 +487,7 @@ void handleNewStreamDataWritten( // or loss buffer, but that's an expensive search. stream.currentWriteOffset += frameLen; ChainedByteRangeHead bufWritten( - stream.pendingWrites.splitAtMost(folly::to(frameLen))); + stream.pendingWrites.splitAtMost(static_cast(frameLen))); DCHECK_EQ(bufWritten.chainLength(), frameLen); // TODO: If we want to be able to write FIN out of order for DSR-ed streams, // this needs to be fixed: @@ -1737,8 +1737,8 @@ folly::Expected writeConnectionDataToSocket( writeLoopTimeLimit(writeLoopBeginTime, connection))) { auto packetNum = getNextPacketNum(connection, pnSpace); auto header = builder(srcConnId, dstConnId, packetNum, version, token); - uint32_t writableBytes = folly::to(std::min( - connection.udpSendPacketLen, writableBytesFunc(connection))); + uint32_t writableBytes = std::min( + connection.udpSendPacketLen, writableBytesFunc(connection)); uint64_t cipherOverhead = aead.getCipherOverhead(); if (writableBytes < cipherOverhead) { writableBytes = 0; @@ -1803,8 +1803,8 @@ folly::Expected writeConnectionDataToSocket( std::move(result->clonedPacketIdentifier), std::move(result->packet->packet), sentTime, - folly::to(ret->encodedSize), - folly::to(ret->encodedBodySize), + static_cast(ret->encodedSize), + static_cast(ret->encodedBodySize), false /* isDSRPacket */); if (updateConnResult.hasError()) { return folly::makeUnexpected(updateConnResult.error()); diff --git a/quic/client/BUCK b/quic/client/BUCK index 9781f4b8b..aaba66c18 100644 --- a/quic/client/BUCK +++ b/quic/client/BUCK @@ -103,6 +103,8 @@ mvfst_cpp_library( "handshake/ClientTransportParametersExtension.h", ], exported_deps = [ + "//folly:expected", + "//quic:exception", "//quic/handshake:transport_parameters", ], ) @@ -126,7 +128,6 @@ mvfst_cpp_library( "QuicClientAsyncTransport.h", ], deps = [ - "//folly:conv", "//folly/experimental/symbolizer:symbolizer", ], exported_deps = [ diff --git a/quic/client/QuicClientAsyncTransport.cpp b/quic/client/QuicClientAsyncTransport.cpp index 2b90d30ab..2d06daa4d 100644 --- a/quic/client/QuicClientAsyncTransport.cpp +++ b/quic/client/QuicClientAsyncTransport.cpp @@ -7,7 +7,6 @@ #include -#include #include namespace quic { diff --git a/quic/codec/BUCK b/quic/codec/BUCK index ae0dc98c4..4d60d42ef 100644 --- a/quic/codec/BUCK +++ b/quic/codec/BUCK @@ -22,7 +22,6 @@ mvfst_cpp_library( ], exported_deps = [ ":packet_number", - "//folly:conv", "//folly:expected", "//folly:network_address", "//folly:string", @@ -53,7 +52,6 @@ mvfst_cpp_library( "PacketNumber.h", ], deps = [ - "//folly:conv", "//folly/lang:bits", "//quic:constants", "//quic:exception", diff --git a/quic/codec/Decode.cpp b/quic/codec/Decode.cpp index d94c8f477..cb3cb35db 100644 --- a/quic/codec/Decode.cpp +++ b/quic/codec/Decode.cpp @@ -170,7 +170,7 @@ folly::Expected decodeAckFrame( return folly::makeUnexpected(QuicError( quic::TransportErrorCode::FRAME_ENCODING_ERROR, "Bad largest acked")); } - auto largestAcked = folly::to(largestAckedInt->first); + PacketNum largestAcked = largestAckedInt->first; auto ackDelay = decodeQuicInteger(cursor); if (!ackDelay) { return folly::makeUnexpected(QuicError( @@ -456,7 +456,7 @@ folly::Expected decodeRstStreamFrame( } } return RstStreamFrame( - folly::to(streamId->first), + streamId->first, errorCode, finalSize->first, reliableSize ? Optional(reliableSize->first) : std::nullopt); @@ -478,7 +478,7 @@ folly::Expected decodeStopSendingFrame( quic::TransportErrorCode::FRAME_ENCODING_ERROR, "Cannot decode error code")); } - return StopSendingFrame(folly::to(streamId->first), errorCode); + return StopSendingFrame(streamId->first, errorCode); } folly::Expected decodeCryptoFrame(Cursor& cursor) { @@ -609,11 +609,7 @@ folly::Expected decodeStreamFrame( } } return ReadStreamFrame( - folly::to(streamId->first), - offset, - std::move(data), - fin, - groupId); + streamId->first, offset, std::move(data), fin, groupId); } folly::Expected decodeMaxDataFrame(Cursor& cursor) { @@ -637,8 +633,7 @@ folly::Expected decodeMaxStreamDataFrame( return folly::makeUnexpected(QuicError( quic::TransportErrorCode::FRAME_ENCODING_ERROR, "Invalid offset")); } - return MaxStreamDataFrame( - folly::to(streamId->first), offset->first); + return MaxStreamDataFrame(streamId->first, offset->first); } folly::Expected decodeBiDiMaxStreamsFrame( @@ -685,8 +680,7 @@ folly::Expected decodeStreamDataBlockedFrame( return folly::makeUnexpected(QuicError( quic::TransportErrorCode::FRAME_ENCODING_ERROR, "Bad offset")); } - return StreamDataBlockedFrame( - folly::to(streamId->first), dataLimit->first); + return StreamDataBlockedFrame(streamId->first, dataLimit->first); } folly::Expected decodeBiDiStreamsBlockedFrame( @@ -697,8 +691,7 @@ folly::Expected decodeBiDiStreamsBlockedFrame( quic::TransportErrorCode::FRAME_ENCODING_ERROR, "Bad Bi-Directional streamId")); } - return StreamsBlockedFrame( - folly::to(streamId->first), true /* isBidirectional */); + return StreamsBlockedFrame(streamId->first, true /* isBidirectional */); } folly::Expected decodeUniStreamsBlockedFrame( @@ -709,8 +702,7 @@ folly::Expected decodeUniStreamsBlockedFrame( quic::TransportErrorCode::FRAME_ENCODING_ERROR, "Bad Uni-direcitonal streamId")); } - return StreamsBlockedFrame( - folly::to(streamId->first), false /* isBidirectional */); + return StreamsBlockedFrame(streamId->first, false /* isBidirectional */); } folly::Expected decodeNewConnectionIdFrame( diff --git a/quic/codec/PacketNumber.cpp b/quic/codec/PacketNumber.cpp index bfc0996f2..ffdf43836 100644 --- a/quic/codec/PacketNumber.cpp +++ b/quic/codec/PacketNumber.cpp @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -#include #include #include #include diff --git a/quic/codec/QuicInteger.cpp b/quic/codec/QuicInteger.cpp index ff05ee72c..207ddfbcd 100644 --- a/quic/codec/QuicInteger.cpp +++ b/quic/codec/QuicInteger.cpp @@ -7,8 +7,6 @@ #include -#include - namespace quic { folly::Expected getQuicIntegerSize(uint64_t value) { diff --git a/quic/codec/QuicPacketBuilder.cpp b/quic/codec/QuicPacketBuilder.cpp index a0b0c9337..a595c8c7f 100644 --- a/quic/codec/QuicPacketBuilder.cpp +++ b/quic/codec/QuicPacketBuilder.cpp @@ -68,7 +68,7 @@ encodeLongHeaderHelper( spaceCounter -= longHeaderSize; } bufop.template writeBE( - folly::to(longHeader.getVersion())); + static_cast(longHeader.getVersion())); bufop.template writeBE(longHeader.getDestinationConnId().size()); bufop.push( longHeader.getDestinationConnId().data(), @@ -147,7 +147,7 @@ uint32_t RegularQuicPacketBuilder::getHeaderBytes() const { bool isLongHeader = packet_.header.getHeaderForm() == HeaderForm::Long; CHECK(packetNumberEncoding_) << "packetNumberEncoding_ should be valid after ctor"; - return folly::to(header_.computeChainDataLength()) + + return static_cast(header_.computeChainDataLength()) + (isLongHeader ? packetNumberEncoding_->length + kMaxPacketLenSize : 0); } @@ -808,7 +808,7 @@ bool InplaceQuicPacketBuilder::canBuildPacket() const noexcept { uint32_t InplaceQuicPacketBuilder::getHeaderBytes() const { CHECK(packetNumberEncoding_) << "packetNumberEncoding_ should be valid after ctor"; - return folly::to(bodyStart_ - headerStart_); + return static_cast(bodyStart_ - headerStart_); } bool RegularQuicPacketBuilder::hasFramesPending() const { diff --git a/quic/codec/QuicWriteCodec.cpp b/quic/codec/QuicWriteCodec.cpp index e75e92632..bb4a9eda4 100644 --- a/quic/codec/QuicWriteCodec.cpp +++ b/quic/codec/QuicWriteCodec.cpp @@ -21,7 +21,7 @@ namespace { * Return: true if there is enough space, false otherwise */ bool packetSpaceCheck(uint64_t limit, size_t require) { - return (folly::to(require) <= limit); + return (static_cast(require) <= limit); } } // namespace diff --git a/quic/codec/Types.h b/quic/codec/Types.h index 96d68f4a0..9afe8c2db 100644 --- a/quic/codec/Types.h +++ b/quic/codec/Types.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include #include diff --git a/quic/common/TransportKnobs.cpp b/quic/common/TransportKnobs.cpp index a8c32a8be..d9f38e3d0 100644 --- a/quic/common/TransportKnobs.cpp +++ b/quic/common/TransportKnobs.cpp @@ -38,11 +38,11 @@ Optional parseTransportKnobs( opts.parse_numbers_as_strings = true; folly::dynamic params = folly::parseJson(serializedParams, opts); for (const auto& id : params.keys()) { - auto paramId = folly::to(id.asInt()); + auto paramId = static_cast(id.asInt()); auto val = params[id]; switch (val.type()) { case folly::dynamic::Type::BOOL: - knobParams.push_back({paramId, folly::to(val.asInt())}); + knobParams.push_back({paramId, static_cast(val.asInt())}); continue; case folly::dynamic::Type::STRING: { /* @@ -79,7 +79,7 @@ Optional parseTransportKnobs( congestionControlStrToType(val.asString()); if (cctype) { knobParams.push_back( - {paramId, folly::to(cctype.value())}); + {paramId, static_cast(cctype.value())}); } else { LOG(ERROR) << "unknown cc type " << val; return std::nullopt; @@ -122,7 +122,7 @@ Optional parseTransportKnobs( // transport knobs must be a single int, so we pack numerator and // denominator into a single int here and unpack in the handler factor = numerator * kKnobFractionMax + denominator; - knobParams.push_back({paramId, folly::to(factor)}); + knobParams.push_back({paramId, factor}); } else if (paramId == TransportKnobParamId::NO_OP) { // No further processing needed. Ignore this knob parameter. VLOG(4) << "Skipping over noop transport knob"; diff --git a/quic/common/test/TestUtils.cpp b/quic/common/test/TestUtils.cpp index 2c5b6c0e3..dcabd7bbe 100644 --- a/quic/common/test/TestUtils.cpp +++ b/quic/common/test/TestUtils.cpp @@ -330,7 +330,7 @@ RegularQuicPacketBuilder::Packet createStreamPacket( writeStreamFrameData( *builder, std::move(dataBuf), - std::min(folly::to(dataLen), data.computeChainDataLength())); + std::min(static_cast(dataLen), data.computeChainDataLength())); return std::move(*builder).buildPacket(); } diff --git a/quic/congestion_control/BUCK b/quic/congestion_control/BUCK index 3cff5cb22..bf8973072 100644 --- a/quic/congestion_control/BUCK +++ b/quic/congestion_control/BUCK @@ -11,7 +11,8 @@ mvfst_cpp_library( "Bandwidth.h", ], deps = [ - "//folly:conv", + "fbsource//third-party/fmt:fmt", + "//folly/lang:assume", ], ) diff --git a/quic/congestion_control/Bandwidth.cpp b/quic/congestion_control/Bandwidth.cpp index 7f4a0f455..4bc01bb01 100644 --- a/quic/congestion_control/Bandwidth.cpp +++ b/quic/congestion_control/Bandwidth.cpp @@ -5,10 +5,10 @@ * LICENSE file in the root directory of this source tree. */ +#include +#include #include -#include - namespace quic { std::string Bandwidth::unitName() const noexcept { diff --git a/quic/congestion_control/QuicCubic.cpp b/quic/congestion_control/QuicCubic.cpp index 1395b877d..aec86885c 100644 --- a/quic/congestion_control/QuicCubic.cpp +++ b/quic/congestion_control/QuicCubic.cpp @@ -289,12 +289,13 @@ uint64_t Cubic::calculateCubicCwnd(int64_t delta) noexcept { // packet size. Linux also has a limit the cwnd increase to 1 MSS per 2 ACKs. if (delta > 0 && (std::numeric_limits::max() - *steadyState_.lastMaxCwndBytes < - folly::to(delta))) { + static_cast(delta))) { LOG(WARNING) << "Quic Cubic: overflow cwnd cut at uint64_t max"; return conn_.transportSettings.maxCwndInMss * conn_.udpSendPacketLen; } else if ( delta < 0 && - (folly::to(std::abs(delta)) > *steadyState_.lastMaxCwndBytes)) { + (static_cast(std::abs(delta)) > + *steadyState_.lastMaxCwndBytes)) { LOG(WARNING) << "Quic Cubic: underflow cwnd cut at minCwndBytes_ " << conn_; return conn_.transportSettings.minCwndInMss * conn_.udpSendPacketLen; } else { diff --git a/quic/fizz/client/handshake/test/FizzClientHandshakeTest.cpp b/quic/fizz/client/handshake/test/FizzClientHandshakeTest.cpp index 21485367f..180504c36 100644 --- a/quic/fizz/client/handshake/test/FizzClientHandshakeTest.cpp +++ b/quic/fizz/client/handshake/test/FizzClientHandshakeTest.cpp @@ -50,23 +50,24 @@ class ClientHandshakeTest : public Test, public boost::static_visitor<> { } virtual void connect() { - CHECK(!handshake - ->connect( - hostname, - std::make_shared( - QuicVersion::MVFST, - folly::to(kDefaultConnectionFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultMaxStreamsBidirectional), - folly::to(kDefaultMaxStreamsUnidirectional), - kDefaultIdleTimeout, - kDefaultAckDelayExponent, - kDefaultUDPSendPacketLen, - kDefaultActiveConnectionIdLimit, - ConnectionId::createZeroLength())) - .hasError()); + CHECK( + !handshake + ->connect( + hostname, + std::make_shared( + QuicVersion::MVFST, + static_cast(kDefaultConnectionFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultMaxStreamsBidirectional), + static_cast(kDefaultMaxStreamsUnidirectional), + kDefaultIdleTimeout, + kDefaultAckDelayExponent, + kDefaultUDPSendPacketLen, + kDefaultActiveConnectionIdLimit, + ConnectionId::createZeroLength())) + .hasError()); } void SetUp() override { @@ -97,10 +98,10 @@ class ClientHandshakeTest : public Test, public boost::static_visitor<> { auto serverTransportParameters = std::make_shared( getVersion(), - folly::to(kDefaultConnectionFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), + static_cast(kDefaultConnectionFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), std::numeric_limits::max(), std::numeric_limits::max(), /*disableMigration=*/true, @@ -436,23 +437,24 @@ class ClientHandshakeCallbackTest : public ClientHandshakeTest { } void connect() override { - CHECK(!handshake - ->connect( - hostname, - std::make_shared( - QuicVersion::MVFST, - folly::to(kDefaultConnectionFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultMaxStreamsBidirectional), - folly::to(kDefaultMaxStreamsUnidirectional), - kDefaultIdleTimeout, - kDefaultAckDelayExponent, - kDefaultUDPSendPacketLen, - kDefaultActiveConnectionIdLimit, - ConnectionId::createZeroLength())) - .hasError()); + CHECK( + !handshake + ->connect( + hostname, + std::make_shared( + QuicVersion::MVFST, + static_cast(kDefaultConnectionFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultMaxStreamsBidirectional), + static_cast(kDefaultMaxStreamsUnidirectional), + kDefaultIdleTimeout, + kDefaultAckDelayExponent, + kDefaultUDPSendPacketLen, + kDefaultActiveConnectionIdLimit, + ConnectionId::createZeroLength())) + .hasError()); } protected: @@ -548,23 +550,24 @@ class ClientHandshakeZeroRttTest : public ClientHandshakeTest { } void connect() override { - CHECK(!handshake - ->connect( - hostname, - std::make_shared( - QuicVersion::MVFST, - folly::to(kDefaultConnectionFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultStreamFlowControlWindow), - folly::to(kDefaultMaxStreamsBidirectional), - folly::to(kDefaultMaxStreamsUnidirectional), - kDefaultIdleTimeout, - kDefaultAckDelayExponent, - kDefaultUDPSendPacketLen, - kDefaultActiveConnectionIdLimit, - ConnectionId::createZeroLength())) - .hasError()); + CHECK( + !handshake + ->connect( + hostname, + std::make_shared( + QuicVersion::MVFST, + static_cast(kDefaultConnectionFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultStreamFlowControlWindow), + static_cast(kDefaultMaxStreamsBidirectional), + static_cast(kDefaultMaxStreamsUnidirectional), + kDefaultIdleTimeout, + kDefaultAckDelayExponent, + kDefaultUDPSendPacketLen, + kDefaultActiveConnectionIdLimit, + ConnectionId::createZeroLength())) + .hasError()); } virtual void setupZeroRttServer() { diff --git a/quic/server/BUCK b/quic/server/BUCK index 64481d7c7..a5d600f8c 100644 --- a/quic/server/BUCK +++ b/quic/server/BUCK @@ -61,7 +61,6 @@ mvfst_cpp_library( "fbsource//third-party/fmt:fmt", ":accept_observer", "//common/network:mvfst_hooks", # @manual - "//folly:conv", "//folly/chrono:conv", "//folly/io:iobuf", "//folly/io/async:event_base_manager", diff --git a/quic/server/QuicServerWorker.cpp b/quic/server/QuicServerWorker.cpp index 61484dde8..b929b3329 100644 --- a/quic/server/QuicServerWorker.cpp +++ b/quic/server/QuicServerWorker.cpp @@ -22,7 +22,6 @@ #define SOF_TIMESTAMPING_SOFTWARE 0 #endif -#include #include #include #include @@ -332,8 +331,11 @@ void QuicServerWorker::onDataAvailable( auto originalPacketReceiveTime = packetReceiveTime; if (params.ts) { // This is the software system time from the datagram. + const auto& tsTimespec = params.ts.value()[0]; auto packetRxEpochUs = - folly::to(params.ts.value()[0]); + std::chrono::duration_cast( + std::chrono::seconds(tsTimespec.tv_sec) + + std::chrono::nanoseconds(tsTimespec.tv_nsec)); if (packetRxEpochUs != 0us) { auto now = std::chrono::system_clock::now(); auto nowEpochUs = std::chrono::duration_cast( diff --git a/quic/server/async_tran/BUCK b/quic/server/async_tran/BUCK index 2c8db9360..db781ea0e 100644 --- a/quic/server/async_tran/BUCK +++ b/quic/server/async_tran/BUCK @@ -14,9 +14,6 @@ mvfst_cpp_library( "QuicAsyncTransportServer.h", "QuicServerAsyncTransport.h", ], - deps = [ - "//folly:conv", - ], exported_deps = [ "//folly/io/async:async_transport", "//folly/io/async:scoped_event_base_thread", diff --git a/quic/server/async_tran/QuicServerAsyncTransport.cpp b/quic/server/async_tran/QuicServerAsyncTransport.cpp index 10825bef0..b405e5cd4 100644 --- a/quic/server/async_tran/QuicServerAsyncTransport.cpp +++ b/quic/server/async_tran/QuicServerAsyncTransport.cpp @@ -7,8 +7,6 @@ #include -#include - namespace quic { void QuicServerAsyncTransport::setServerSocket( diff --git a/quic/server/test/QuicServerTransportTest.cpp b/quic/server/test/QuicServerTransportTest.cpp index e35b4eb0d..e8db8346d 100644 --- a/quic/server/test/QuicServerTransportTest.cpp +++ b/quic/server/test/QuicServerTransportTest.cpp @@ -3894,7 +3894,7 @@ TEST_F( writeStreamFrameData( builder, data->clone(), - std::min(folly::to(dataLen), data->computeChainDataLength())); + std::min(static_cast(dataLen), data->computeChainDataLength())); ASSERT_FALSE(builder.encodePacketHeader().hasError()); builder.accountForCipherOverhead(0); @@ -3938,7 +3938,7 @@ TEST_F( writeStreamFrameData( builder, data->clone(), - std::min(folly::to(dataLen), data->computeChainDataLength())); + std::min(static_cast(dataLen), data->computeChainDataLength())); ASSERT_FALSE(builder.encodePacketHeader().hasError()); builder.accountForCipherOverhead(0); @@ -3983,7 +3983,7 @@ TEST_F( writeStreamFrameData( builder, data->clone(), - std::min(folly::to(dataLen), data->computeChainDataLength())); + std::min(static_cast(dataLen), data->computeChainDataLength())); ASSERT_FALSE(builder.encodePacketHeader().hasError()); builder.accountForCipherOverhead(0); diff --git a/quic/state/test/QuicStreamManagerTest.cpp b/quic/state/test/QuicStreamManagerTest.cpp index 4e0a81fcb..90cb7d2bd 100644 --- a/quic/state/test/QuicStreamManagerTest.cpp +++ b/quic/state/test/QuicStreamManagerTest.cpp @@ -802,7 +802,7 @@ TEST_P(QuicStreamManagerTest, TestReliableResetBasic) { // A frame of length 4 has been written to the wire quicStreamState->currentWriteOffset += 4; ChainedByteRangeHead bufWritten1( - quicStreamState->pendingWrites.splitAtMost(folly::to(4))); + quicStreamState->pendingWrites.splitAtMost(4)); quicStreamState->retransmissionBuffer.emplace( std::piecewise_construct, std::forward_as_tuple(5), @@ -814,7 +814,7 @@ TEST_P(QuicStreamManagerTest, TestReliableResetBasic) { // A frame of length 2 has been written to the wire quicStreamState->currentWriteOffset += 2; ChainedByteRangeHead bufWritten2( - quicStreamState->pendingWrites.splitAtMost(folly::to(2))); + quicStreamState->pendingWrites.splitAtMost(2)); quicStreamState->retransmissionBuffer.emplace( std::piecewise_construct, std::forward_as_tuple(9),