More code

This commit is contained in:
Carl Lerche
2017-08-04 17:25:39 -07:00
parent fc0a7eb898
commit 1c55ad75ea
8 changed files with 139 additions and 40 deletions

View File

@@ -23,16 +23,21 @@ fn send_recv_headers_only() {
.read(&[0, 0, 1, 1, 5, 0, 0, 0, 1, 0x89])
.build();
let h2 = client::handshake(mock)
let mut h2 = Client::handshake(mock)
.wait().unwrap();
// Send the request
let mut request = request::Head::default();
request.uri = "https://http2.akamai.com/".parse().unwrap();
let request = Request::builder()
.uri("https://http2.akamai.com/")
.body(()).unwrap();
info!("sending request");
let h2 = h2.send_request(1.into(), request, true).wait().unwrap();
let stream = h2.request(request, true).unwrap();
let resp = stream.select2(h2).wait().ok().unwrap();
println!("GOT: {:?}", resp);
/*
// Get the response
info!("getting response");
@@ -48,8 +53,10 @@ fn send_recv_headers_only() {
// No more frames
info!("ensure no more responses");
assert!(Stream::wait(h2).next().is_none());;
*/
}
/*
#[test]
fn send_recv_data() {
let _ = env_logger::init();
@@ -257,3 +264,4 @@ fn send_data_without_headers() {
#[ignore]
fn exceed_max_streams() {
}
*/

View File

@@ -18,12 +18,12 @@ pub use self::http::{
response,
method,
status,
Request,
Response,
};
pub use self::h2::{
client,
server,
};
pub use self::h2::client::{self, Client};
// pub use self::h2::server;
pub use self::bytes::{
Buf,