1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-09 10:00:57 +03:00

Only take a QuicServerConnectionState when constructing ServerHandshake (#90)

Summary:
The cryptoState can be derrived from it, so it is redundant to pass it.

This PR depends on https://github.com/facebookincubator/mvfst/issues/88
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/90

Reviewed By: mjoras

Differential Revision: D19622581

Pulled By: yangchi

fbshipit-source-id: b3c88999199673f69c4422b96fbe7f2b0656bf6c
This commit is contained in:
Amaury Séchet
2020-02-12 09:40:52 -08:00
committed by Facebook Github Bot
parent d345eff6af
commit 2f8774c921
4 changed files with 5 additions and 9 deletions

View File

@@ -15,12 +15,10 @@
#include <fizz/protocol/Protocol.h> #include <fizz/protocol/Protocol.h>
namespace quic { namespace quic {
ServerHandshake::ServerHandshake( ServerHandshake::ServerHandshake(QuicConnectionStateBase* conn)
QuicConnectionStateBase* conn,
QuicCryptoState& cryptoState)
: conn_(conn), : conn_(conn),
actionGuard_(nullptr), actionGuard_(nullptr),
cryptoState_(cryptoState), cryptoState_(*conn->cryptoState),
visitor_(*this) {} visitor_(*this) {}
void ServerHandshake::accept( void ServerHandshake::accept(

View File

@@ -71,9 +71,7 @@ class ServerHandshake : public Handshake {
*/ */
enum class Phase { Handshake, KeysDerived, Established }; enum class Phase { Handshake, KeysDerived, Established };
explicit ServerHandshake( explicit ServerHandshake(QuicConnectionStateBase* conn);
QuicConnectionStateBase* conn,
QuicCryptoState& cryptoState);
/** /**
* Starts accepting the TLS connection. * Starts accepting the TLS connection.

View File

@@ -133,7 +133,7 @@ struct QuicServerConnectionState : public QuicConnectionStateBase {
QuicVersion::QUIC_DRAFT, QuicVersion::QUIC_DRAFT,
QuicVersion::QUIC_DRAFT_23}}; QuicVersion::QUIC_DRAFT_23}};
originalVersion = QuicVersion::MVFST; originalVersion = QuicVersion::MVFST;
serverHandshakeLayer = new ServerHandshake(this, *cryptoState); serverHandshakeLayer = new ServerHandshake(this);
handshakeLayer.reset(serverHandshakeLayer); handshakeLayer.reset(serverHandshakeLayer);
// We shouldn't normally need to set this until we're starting the // We shouldn't normally need to set this until we're starting the
// transport, however writing unit tests is much easier if we set this here. // transport, however writing unit tests is much easier if we set this here.

View File

@@ -44,7 +44,7 @@ class FakeServerHandshake : public ServerHandshake {
bool chloSync = false, bool chloSync = false,
bool cfinSync = false, bool cfinSync = false,
folly::Optional<uint64_t> clientActiveConnectionIdLimit = folly::none) folly::Optional<uint64_t> clientActiveConnectionIdLimit = folly::none)
: ServerHandshake(&conn, *conn.cryptoState), : ServerHandshake(&conn),
conn_(conn), conn_(conn),
chloSync_(chloSync), chloSync_(chloSync),
cfinSync_(cfinSync), cfinSync_(cfinSync),