1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Move fizz specific part of the client in quic/fizz/client (#120)

Summary:
This create a separate library for the fizz client. This allows complete separation of the fizz part of the client, and make it swapable for something else.

Depends on https://github.com/facebookincubator/mvfst/issues/118
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/120

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=528194164778784
* elb.prod.muc2c01 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ywntlz9n
* flb.prod.fceb2c02 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ns1vzm1j
* olb.prod.ratn0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/0vxebqop
* slb.prod_regional.rnao0c00 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/a8syav0w
* slb.regional.rvll0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/igneyshj
 ---

Reviewed By: mjoras

Differential Revision: D20769060

Pulled By: yangchi

fbshipit-source-id: ad5d66c23b3a9723ad3f8c8091981df99339761e
This commit is contained in:
Amaury Séchet
2020-04-06 11:36:46 -07:00
committed by Facebook GitHub Bot
parent aa4229f6a6
commit fb0b6b1cc4
27 changed files with 89 additions and 53 deletions

View File

@@ -50,7 +50,7 @@ quic_add_test(TARGET QuicPacketSchedulerTest
QuicPacketSchedulerTest.cpp QuicPacketSchedulerTest.cpp
DEPENDS DEPENDS
Folly::folly Folly::folly
mvfst_client mvfst_fizz_client
mvfst_codec_pktbuilder mvfst_codec_pktbuilder
mvfst_transport mvfst_transport
mvfst_test_utils mvfst_test_utils
@@ -62,7 +62,7 @@ quic_add_test(TARGET IoBufQuicBatchTest
IoBufQuicBatchTest.cpp IoBufQuicBatchTest.cpp
DEPENDS DEPENDS
Folly::folly Folly::folly
mvfst_client mvfst_fizz_client
mvfst_transport mvfst_transport
mvfst_state_machine mvfst_state_machine
) )

View File

@@ -9,8 +9,8 @@
#include <quic/api/IoBufQuicBatch.h> #include <quic/api/IoBufQuicBatch.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/state/StateData.h> #include <quic/state/StateData.h>
constexpr const auto kNumLoops = 64; constexpr const auto kNumLoops = 64;

View File

@@ -11,11 +11,11 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <quic/api/test/Mocks.h> #include <quic/api/test/Mocks.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/codec/QuicPacketBuilder.h> #include <quic/codec/QuicPacketBuilder.h>
#include <quic/codec/test/Mocks.h> #include <quic/codec/test/Mocks.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/server/state/ServerStateMachine.h> #include <quic/server/state/ServerStateMachine.h>
#include <quic/state/QuicStreamFunctions.h> #include <quic/state/QuicStreamFunctions.h>

View File

@@ -7,8 +7,6 @@ add_library(
mvfst_client STATIC mvfst_client STATIC
QuicClientTransport.cpp QuicClientTransport.cpp
handshake/ClientHandshake.cpp handshake/ClientHandshake.cpp
handshake/FizzClientQuicHandshakeContext.cpp
handshake/FizzClientHandshake.cpp
state/ClientStateMachine.cpp state/ClientStateMachine.cpp
) )
@@ -28,7 +26,6 @@ add_dependencies(
mvfst_client mvfst_client
mvfst_bufutil mvfst_bufutil
mvfst_flowcontrol mvfst_flowcontrol
mvfst_fizz_handshake
mvfst_happyeyeballs mvfst_happyeyeballs
mvfst_loss mvfst_loss
mvfst_qlogger mvfst_qlogger
@@ -42,7 +39,6 @@ target_link_libraries(
mvfst_client PUBLIC mvfst_client PUBLIC
Folly::folly Folly::folly
mvfst_flowcontrol mvfst_flowcontrol
mvfst_fizz_handshake
mvfst_happyeyeballs mvfst_happyeyeballs
mvfst_loss mvfst_loss
mvfst_qlogger mvfst_qlogger
@@ -68,6 +64,3 @@ install(
EXPORT mvfst-exports EXPORT mvfst-exports
DESTINATION lib DESTINATION lib
) )
add_subdirectory(test)
add_subdirectory(handshake/test)

View File

@@ -14,7 +14,6 @@
#include <folly/io/async/AsyncUDPSocket.h> #include <folly/io/async/AsyncUDPSocket.h>
#include <folly/net/NetOps.h> #include <folly/net/NetOps.h>
#include <quic/api/QuicTransportBase.h> #include <quic/api/QuicTransportBase.h>
#include <quic/client/handshake/QuicPskCache.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/common/BufUtil.h> #include <quic/common/BufUtil.h>

View File

@@ -9,8 +9,8 @@
#include <quic/client/handshake/ClientHandshake.h> #include <quic/client/handshake/ClientHandshake.h>
#include <quic/client/handshake/ClientTransportParametersExtension.h> #include <quic/client/handshake/ClientTransportParametersExtension.h>
#include <quic/client/handshake/QuicPskCache.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/fizz/client/handshake/QuicPskCache.h>
#include <quic/state/QuicStreamFunctions.h> #include <quic/state/QuicStreamFunctions.h>
namespace quic { namespace quic {

View File

@@ -17,7 +17,6 @@ add_library(
target_include_directories( target_include_directories(
mvfst_test_utils PUBLIC mvfst_test_utils PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${LIBFIZZ_INCLUDE_DIR}>
${LIBGMOCK_INCLUDE_DIR} ${LIBGMOCK_INCLUDE_DIR}
${LIBGTEST_INCLUDE_DIR} ${LIBGTEST_INCLUDE_DIR}
) )
@@ -30,10 +29,9 @@ target_compile_options(
add_dependencies( add_dependencies(
mvfst_test_utils mvfst_test_utils
mvfst_client mvfst_fizz_client
mvfst_codec_pktbuilder mvfst_codec_pktbuilder
mvfst_codec_types mvfst_codec_types
mvfst_fizz_handshake
mvfst_server mvfst_server
mvfst_state_machine mvfst_state_machine
mvfst_transport mvfst_transport
@@ -42,13 +40,11 @@ add_dependencies(
target_link_libraries( target_link_libraries(
mvfst_test_utils PUBLIC mvfst_test_utils PUBLIC
Folly::folly Folly::folly
${LIBFIZZ_LIBRARY}
${LIBGMOCK_LIBRARIES} ${LIBGMOCK_LIBRARIES}
${LIBGTEST_LIBRARIES} ${LIBGTEST_LIBRARIES}
mvfst_client mvfst_fizz_client
mvfst_codec_pktbuilder mvfst_codec_pktbuilder
mvfst_codec_types mvfst_codec_types
mvfst_fizz_handshake
mvfst_server mvfst_server
mvfst_state_machine mvfst_state_machine
mvfst_transport mvfst_transport
@@ -64,12 +60,10 @@ quic_add_test(TARGET QuicCommonUtilTest SOURCES
BufUtilTest.cpp BufUtilTest.cpp
DEPENDS DEPENDS
Folly::folly Folly::folly
${LIBFIZZ_LIBRARY}
mvfst_bufutil mvfst_bufutil
mvfst_client mvfst_fizz_client
mvfst_codec_pktbuilder mvfst_codec_pktbuilder
mvfst_codec_types mvfst_codec_types
mvfst_fizz_handshake
mvfst_looper mvfst_looper
mvfst_transport mvfst_transport
mvfst_server mvfst_server

View File

@@ -8,10 +8,10 @@
#pragma once #pragma once
#include <quic/client/handshake/QuicPskCache.h>
#include <quic/codec/QuicPacketBuilder.h> #include <quic/codec/QuicPacketBuilder.h>
#include <quic/codec/Types.h> #include <quic/codec/Types.h>
#include <quic/common/BufUtil.h> #include <quic/common/BufUtil.h>
#include <quic/fizz/client/handshake/QuicPskCache.h>
#include <quic/handshake/test/Mocks.h> #include <quic/handshake/test/Mocks.h>
#include <quic/logging/FileQLogger.h> #include <quic/logging/FileQLogger.h>
#include <quic/server/state/ServerStateMachine.h> #include <quic/server/state/ServerStateMachine.h>

View File

@@ -3,4 +3,5 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
add_subdirectory(client)
add_subdirectory(handshake) add_subdirectory(handshake)

View File

@@ -0,0 +1,56 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
add_library(
mvfst_fizz_client STATIC
handshake/FizzClientQuicHandshakeContext.cpp
handshake/FizzClientHandshake.cpp
)
target_include_directories(
mvfst_fizz_client PUBLIC
$<BUILD_INTERFACE:${QUIC_FBCODE_ROOT}>
$<INSTALL_INTERFACE:include/>
)
target_compile_options(
mvfst_fizz_client
PRIVATE
${_QUIC_COMMON_COMPILE_OPTIONS}
)
add_dependencies(
mvfst_fizz_client
mvfst_client
mvfst_fizz_handshake
mvfst_codec_packet_number_cipher
)
target_link_libraries(
mvfst_fizz_client PUBLIC
mvfst_client
mvfst_fizz_handshake
mvfst_codec_packet_number_cipher
)
file(
GLOB_RECURSE QUIC_API_HEADERS_TOINSTALL
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.h
)
list(FILTER QUIC_API_HEADERS_TOINSTALL EXCLUDE REGEX test/)
foreach(header ${QUIC_API_HEADERS_TOINSTALL})
get_filename_component(header_dir ${header} DIRECTORY)
install(FILES ${header} DESTINATION include/quic/fizz/client/${header_dir})
endforeach()
install(
TARGETS mvfst_fizz_client
EXPORT mvfst-exports
DESTINATION lib
)
add_subdirectory(test)
add_subdirectory(handshake/test)

View File

@@ -6,12 +6,12 @@
* *
*/ */
#include <quic/client/handshake/FizzClientHandshake.h> #include <quic/fizz/client/handshake/FizzClientHandshake.h>
#include <quic/client/handshake/FizzClientExtensions.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/handshake/QuicPskCache.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/fizz/client/handshake/FizzClientExtensions.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/fizz/client/handshake/QuicPskCache.h>
#include <quic/fizz/handshake/FizzBridge.h> #include <quic/fizz/handshake/FizzBridge.h>
#include <fizz/client/EarlyDataRejectionPolicy.h> #include <fizz/client/EarlyDataRejectionPolicy.h>

View File

@@ -6,9 +6,9 @@
* *
*/ */
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h> #include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/handshake/FizzClientHandshake.h> #include <quic/fizz/client/handshake/FizzClientHandshake.h>
namespace quic { namespace quic {

View File

@@ -10,7 +10,7 @@
#include <quic/client/handshake/ClientHandshakeFactory.h> #include <quic/client/handshake/ClientHandshakeFactory.h>
#include <quic/client/handshake/QuicPskCache.h> #include <quic/fizz/client/handshake/QuicPskCache.h>
#include <fizz/client/FizzClientContext.h> #include <fizz/client/FizzClientContext.h>
#include <fizz/protocol/DefaultCertificateVerifier.h> #include <fizz/protocol/DefaultCertificateVerifier.h>

View File

@@ -9,16 +9,12 @@ endif()
quic_add_test(TARGET ClientHandshakeTest quic_add_test(TARGET ClientHandshakeTest
SOURCES SOURCES
ClientHandshakeTest.cpp FizzClientHandshakeTest.cpp
FizzClientExtensionsTest.cpp FizzClientExtensionsTest.cpp
DEPENDS DEPENDS
Folly::folly mvfst_fizz_client
${LIBFIZZ_LIBRARY}
mvfst_client
mvfst_codec_types mvfst_codec_types
mvfst_constants mvfst_constants
mvfst_fizz_handshake
mvfst_server mvfst_server
mvfst_state_machine
mvfst_test_utils mvfst_test_utils
) )

View File

@@ -8,8 +8,8 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <quic/client/handshake/FizzClientExtensions.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientExtensions.h>
#include <fizz/protocol/test/TestMessages.h> #include <fizz/protocol/test/TestMessages.h>

View File

@@ -24,11 +24,11 @@
#include <folly/ssl/Init.h> #include <folly/ssl/Init.h>
#include <quic/client/handshake/ClientTransportParametersExtension.h> #include <quic/client/handshake/ClientTransportParametersExtension.h>
#include <quic/client/handshake/FizzClientHandshake.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/handshake/test/MockQuicPskCache.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientHandshake.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/fizz/client/handshake/test/MockQuicPskCache.h>
#include <quic/fizz/handshake/FizzBridge.h> #include <quic/fizz/handshake/FizzBridge.h>
#include <quic/fizz/handshake/QuicFizzFactory.h> #include <quic/fizz/handshake/QuicFizzFactory.h>
#include <quic/state/QuicStreamFunctions.h> #include <quic/state/QuicStreamFunctions.h>

View File

@@ -8,7 +8,7 @@
#pragma once #pragma once
#include <quic/client/handshake/QuicPskCache.h> #include <quic/fizz/client/handshake/QuicPskCache.h>
#include <folly/Optional.h> #include <folly/Optional.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>

View File

@@ -13,11 +13,8 @@ quic_add_test(TARGET QuicClientTransportTest
DEPENDS DEPENDS
Folly::folly Folly::folly
${LIBGMOCK_LIBRARIES} ${LIBGMOCK_LIBRARIES}
mvfst_bufutil mvfst_fizz_client
mvfst_client
mvfst_codec_types mvfst_codec_types
mvfst_fizz_handshake
mvfst_server mvfst_server
mvfst_test_utils mvfst_test_utils
mvfst_transport
) )

View File

@@ -20,12 +20,12 @@
#include <folly/io/SocketOptionMap.h> #include <folly/io/SocketOptionMap.h>
#include <folly/io/async/ScopedEventBaseThread.h> #include <folly/io/async/ScopedEventBaseThread.h>
#include <folly/io/async/test/MockAsyncUDPSocket.h> #include <folly/io/async/test/MockAsyncUDPSocket.h>
#include <quic/client/handshake/FizzClientHandshake.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/handshake/test/MockQuicPskCache.h>
#include <quic/codec/DefaultConnectionIdAlgo.h> #include <quic/codec/DefaultConnectionIdAlgo.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/congestion_control/CongestionControllerFactory.h> #include <quic/congestion_control/CongestionControllerFactory.h>
#include <quic/fizz/client/handshake/FizzClientHandshake.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/fizz/client/handshake/test/MockQuicPskCache.h>
#include <quic/fizz/handshake/FizzCryptoFactory.h> #include <quic/fizz/handshake/FizzCryptoFactory.h>
#include <quic/handshake/TransportParameters.h> #include <quic/handshake/TransportParameters.h>
#include <quic/handshake/test/Mocks.h> #include <quic/handshake/test/Mocks.h>

View File

@@ -12,10 +12,10 @@
#include <folly/io/async/test/MockAsyncUDPSocket.h> #include <folly/io/async/test/MockAsyncUDPSocket.h>
#include <folly/io/async/test/MockTimeoutManager.h> #include <folly/io/async/test/MockTimeoutManager.h>
#include <quic/api/QuicTransportFunctions.h> #include <quic/api/QuicTransportFunctions.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/codec/DefaultConnectionIdAlgo.h> #include <quic/codec/DefaultConnectionIdAlgo.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/logging/test/Mocks.h> #include <quic/logging/test/Mocks.h>
#include <quic/loss/QuicLossFunctions.h> #include <quic/loss/QuicLossFunctions.h>
#include <quic/server/state/ServerStateMachine.h> #include <quic/server/state/ServerStateMachine.h>

View File

@@ -18,9 +18,9 @@
#include <quic/api/QuicSocket.h> #include <quic/api/QuicSocket.h>
#include <quic/client/QuicClientTransport.h> #include <quic/client/QuicClientTransport.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/common/BufUtil.h> #include <quic/common/BufUtil.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
namespace quic { namespace quic {
namespace samples { namespace samples {

View File

@@ -24,8 +24,8 @@
#include <folly/ssl/Init.h> #include <folly/ssl/Init.h>
#include <quic/QuicConstants.h> #include <quic/QuicConstants.h>
#include <quic/client/handshake/FizzClientExtensions.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientExtensions.h>
#include <quic/fizz/handshake/FizzBridge.h> #include <quic/fizz/handshake/FizzBridge.h>
#include <quic/fizz/handshake/QuicFizzFactory.h> #include <quic/fizz/handshake/QuicFizzFactory.h>
#include <quic/handshake/HandshakeLayer.h> #include <quic/handshake/HandshakeLayer.h>

View File

@@ -12,9 +12,9 @@
#include <quic/state/QuicStreamFunctions.h> #include <quic/state/QuicStreamFunctions.h>
#include <quic/state/QuicStreamUtilities.h> #include <quic/state/QuicStreamUtilities.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/client/state/ClientStateMachine.h> #include <quic/client/state/ClientStateMachine.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/server/state/ServerStateMachine.h> #include <quic/server/state/ServerStateMachine.h>
using namespace folly; using namespace folly;

View File

@@ -15,9 +15,9 @@
#include <folly/stats/Histogram.h> #include <folly/stats/Histogram.h>
#include <quic/client/QuicClientTransport.h> #include <quic/client/QuicClientTransport.h>
#include <quic/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/common/test/TestUtils.h> #include <quic/common/test/TestUtils.h>
#include <quic/congestion_control/CongestionControllerFactory.h> #include <quic/congestion_control/CongestionControllerFactory.h>
#include <quic/fizz/client/handshake/FizzClientQuicHandshakeContext.h>
#include <quic/server/QuicServer.h> #include <quic/server/QuicServer.h>
#include <quic/server/QuicServerTransport.h> #include <quic/server/QuicServerTransport.h>
#include <quic/server/QuicSharedUDPSocketFactory.h> #include <quic/server/QuicSharedUDPSocketFactory.h>