mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-10 21:22:20 +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:
committed by
Facebook Github Bot
parent
d345eff6af
commit
2f8774c921
@@ -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(
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user