refactor(http2): re-enable http2 client and server support

This commit is contained in:
Sean McArthur
2019-08-19 14:03:05 -07:00
parent 4920f5e264
commit 41f4173615
11 changed files with 323 additions and 369 deletions

View File

@@ -163,7 +163,7 @@ where C: Connect + Sync + 'static,
C::Transport: 'static,
C::Future: 'static,
B: Payload + Unpin + Send + 'static,
B::Data: Send,
B::Data: Send + Unpin,
{
/// Send a `GET` request to the supplied `Uri`.
///
@@ -512,8 +512,10 @@ where C: Connect + Sync + 'static,
connecting
};
let is_h2 = is_ver_h2 || connected.alpn == Alpn::H2;
Either::Left(conn_builder
Either::Left(Box::pin(conn_builder
.http2_only(is_h2)
// TODO: convert client::conn::Builder to be by-value?
.clone()
.handshake(io)
.and_then(move |(tx, conn)| {
trace!("handshake complete, spawning background dispatcher task");
@@ -541,7 +543,7 @@ where C: Connect + Sync + 'static,
PoolTx::Http1(tx)
},
})
}))
})))
}))
})
}