diff options
-rw-r--r-- | .bleep | 2 | ||||
-rw-r--r-- | pingora-core/src/protocols/http/v1/client.rs | 7 | ||||
-rw-r--r-- | pingora-core/src/protocols/http/v1/server.rs | 7 |
3 files changed, 15 insertions, 1 deletions
@@ -1 +1 @@ -ba954539761beee5e5d09b66c3a2957212aa499f +904af0c56be96e8e51bc6acd04b1c21cdd48138b
\ No newline at end of file diff --git a/pingora-core/src/protocols/http/v1/client.rs b/pingora-core/src/protocols/http/v1/client.rs index 7125e49..29198b5 100644 --- a/pingora-core/src/protocols/http/v1/client.rs +++ b/pingora-core/src/protocols/http/v1/client.rs @@ -664,6 +664,13 @@ impl HttpSession { pub fn stream(&self) -> &Stream { &self.underlying_stream } + + /// Consume `self`, the underlying [Stream] will be returned and can be used + /// directly, for example, in the case of HTTP upgrade. It is not flushed + /// prior to being returned. + pub fn into_inner(self) -> Stream { + self.underlying_stream + } } #[inline] diff --git a/pingora-core/src/protocols/http/v1/server.rs b/pingora-core/src/protocols/http/v1/server.rs index 8dca9d4..9a4bac5 100644 --- a/pingora-core/src/protocols/http/v1/server.rs +++ b/pingora-core/src/protocols/http/v1/server.rs @@ -1010,6 +1010,13 @@ impl HttpSession { pub fn stream(&self) -> &Stream { &self.underlying_stream } + + /// Consume `self`, the underlying stream will be returned and can be used + /// directly, for example, in the case of HTTP upgrade. The stream is not + /// flushed prior to being returned. + pub fn into_inner(self) -> Stream { + self.underlying_stream + } } // Regex to parse request line that has illegal chars in it |