Line data Source code
1 : #pragma once 2 : 3 : #include "envoy/common/pure.h" 4 : 5 : // Stream Reset is refactored from the codec to avoid cyclical dependencies with 6 : // the BufferMemoryAccount interface. 7 : namespace Envoy { 8 : namespace Http { 9 : 10 : /** 11 : * Stream reset reasons. 12 : */ 13 : enum class StreamResetReason { 14 : // If a local codec level reset was sent on the stream. 15 : LocalReset, 16 : // If a local codec level refused stream reset was sent on the stream (allowing for retry). 17 : LocalRefusedStreamReset, 18 : // If a remote codec level reset was received on the stream. 19 : RemoteReset, 20 : // If a remote codec level refused stream reset was received on the stream (allowing for retry). 21 : RemoteRefusedStreamReset, 22 : // If the stream was locally reset by a connection pool due to an initial local connection 23 : // failure. 24 : LocalConnectionFailure, 25 : // If the stream was locally reset by a connection pool due to an initial remote connection 26 : // failure. 27 : RemoteConnectionFailure, 28 : // If the stream was reset due to timing out while creating a new connection. 29 : ConnectionTimeout, 30 : // If the stream was locally reset due to connection termination. 31 : ConnectionTermination, 32 : // The stream was reset because of a resource overflow. 33 : Overflow, 34 : // Either there was an early TCP error for a CONNECT request or the peer reset with CONNECT_ERROR 35 : ConnectError, 36 : // Received payload did not conform to HTTP protocol. 37 : ProtocolError, 38 : // If the stream was locally reset by the Overload Manager. 39 : OverloadManager 40 : }; 41 : 42 : /** 43 : * Handler to reset an underlying HTTP stream. 44 : */ 45 : class StreamResetHandler { 46 : public: 47 4151 : virtual ~StreamResetHandler() = default; 48 : /** 49 : * Reset the stream. No events will fire beyond this point. 50 : * @param reason supplies the reset reason. 51 : */ 52 : virtual void resetStream(StreamResetReason reason) PURE; 53 : }; 54 : 55 : } // namespace Http 56 : } // namespace Envoy