Line data Source code
1 : #pragma once 2 : 3 : #include "envoy/http/codec.h" 4 : #include "envoy/registry/registry.h" 5 : 6 : #include "source/common/common/assert.h" 7 : #include "source/common/common/logger.h" 8 : #include "source/common/quic/quic_filter_manager_connection_impl.h" 9 : 10 : namespace Envoy { 11 : namespace Quic { 12 : 13 : // QuicHttpConnectionImplBase instance is a thin QUIC codec just providing quic interface to HCM. 14 : // Owned by HCM and created during onNewConnection() if the network connection 15 : // is a QUIC connection. 16 : class QuicHttpConnectionImplBase : public virtual Http::Connection, 17 : protected Logger::Loggable<Logger::Id::quic> { 18 : public: 19 : QuicHttpConnectionImplBase(QuicFilterManagerConnectionImpl& quic_session, 20 : Http::Http3::CodecStats& stats) 21 0 : : quic_session_(quic_session), stats_(stats) {} 22 : 23 : // Http::Connection 24 0 : Http::Status dispatch(Buffer::Instance& /*data*/) override { 25 0 : PANIC("not implemented"); // QUIC connection already hands all data to streams. 26 0 : } 27 0 : Http::Protocol protocol() override { return Http::Protocol::Http3; } 28 : // Returns true if the session has data to send but queued in connection or 29 : // stream send buffer. 30 0 : bool wantsToWrite() override { return quic_session_.bytesToSend() > 0; } 31 : 32 : protected: 33 : QuicFilterManagerConnectionImpl& quic_session_; 34 : Http::Http3::CodecStats& stats_; 35 : }; 36 : 37 : } // namespace Quic 38 : } // namespace Envoy