quic_simple_server_session_helper.h 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_SESSION_HELPER_H_
  5. #define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_SESSION_HELPER_H_
  6. #include "net/third_party/quiche/src/quiche/quic/core/crypto/quic_random.h"
  7. #include "net/third_party/quiche/src/quiche/quic/core/http/quic_server_session_base.h"
  8. namespace net {
  9. // Simple helper for server sessions which generates a new random
  10. // connection ID for stateless rejects.
  11. class QuicSimpleServerSessionHelper
  12. : public quic::QuicCryptoServerStreamBase::Helper {
  13. public:
  14. explicit QuicSimpleServerSessionHelper(quic::QuicRandom* random);
  15. ~QuicSimpleServerSessionHelper() override;
  16. bool CanAcceptClientHello(const quic::CryptoHandshakeMessage& message,
  17. const quic::QuicSocketAddress& client_address,
  18. const quic::QuicSocketAddress& peer_address,
  19. const quic::QuicSocketAddress& self_address,
  20. std::string* error_details) const override;
  21. };
  22. } // namespace net
  23. #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_SESSION_HELPER_H_