mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-10 21:22:20 +03:00
Summary: The CID Algo can possibly generate a CID that's already in the map. This diff adds a mechanism to reject such CID and try another one. ServerStateMachine will loop encoding CIDs until either QuicServerWorker no longer rejects, or encode fails Reviewed By: udippant, vchynarov Differential Revision: D20251043 fbshipit-source-id: a38e4e8b33007779a9710c32057d47f32f7d1774
30 lines
858 B
C++
30 lines
858 B
C++
/*
|
|
* 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.
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <quic/codec/QuicConnectionId.h>
|
|
|
|
namespace quic {
|
|
|
|
/**
|
|
* When ConnectionIdAlgo encodes a ConnectionID, Rejector gives the user a way
|
|
* to reject the resulted ConnectionID. For example, a Quic server may have many
|
|
* ongoing connections that all needs different ConnectionID. If the
|
|
* ConnectionID generated by ConnectionIdAlgo is duplicated to an existing one,
|
|
* the server can use this interface to reject the ConnectionID.
|
|
*/
|
|
class ServerConnectionIdRejector {
|
|
public:
|
|
virtual ~ServerConnectionIdRejector() = default;
|
|
virtual bool rejectConnectionId(const ConnectionId& candidate) const
|
|
noexcept = 0;
|
|
};
|
|
|
|
} // namespace quic
|