Skip to content

Commit a047837

Browse files
committed
Use the same reconnect behavior as before
1 parent 7ed43a9 commit a047837

2 files changed

Lines changed: 170 additions & 114 deletions

File tree

src/http_version.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! HTTP Version support and negotiation
2-
use bytes::Bytes;
32
use hyper::Response;
43
use hyper_util::rt::TokioIo;
54
use std::pin::Pin;
@@ -56,17 +55,15 @@ impl HttpVersion {
5655
}
5756
}
5857

59-
type Http1Sender = hyper::client::conn::http1::SendRequest<http_body_util::Full<Bytes>>;
60-
type Http2Sender = hyper::client::conn::http2::SendRequest<http_body_util::Full<Bytes>>;
58+
type Http1Sender = hyper::client::conn::http1::SendRequest<hyper::body::Incoming>;
59+
type Http2Sender = hyper::client::conn::http2::SendRequest<hyper::body::Incoming>;
6160

62-
type Http1Connection = hyper::client::conn::http1::Connection<
63-
TokioIo<ProxyClientTlsStream>,
64-
http_body_util::Full<Bytes>,
65-
>;
61+
type Http1Connection =
62+
hyper::client::conn::http1::Connection<TokioIo<ProxyClientTlsStream>, hyper::body::Incoming>;
6663

6764
type Http2Connection = hyper::client::conn::http2::Connection<
6865
TokioIo<ProxyClientTlsStream>,
69-
http_body_util::Full<Bytes>,
66+
hyper::body::Incoming,
7067
crate::TokioExecutor,
7168
>;
7269

@@ -91,9 +88,8 @@ impl From<Http2Sender> for HttpSender {
9188
impl HttpSender {
9289
pub async fn send_request(
9390
&mut self,
94-
request: http::Request<Bytes>,
91+
request: http::Request<hyper::body::Incoming>,
9592
) -> Result<Response<hyper::body::Incoming>, hyper::Error> {
96-
let request = request.map(http_body_util::Full::new);
9793
match self {
9894
Self::Http1(sender) => sender.send_request(request).await,
9995
Self::Http2(sender) => sender.send_request(request).await,

0 commit comments

Comments
 (0)