Skip to content

Commit 314172f

Browse files
committed
cargo update -p hyper and move away from deprecated bind_connection API
1 parent 7d6fc89 commit 314172f

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Cargo.lock

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tests/record.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,19 @@ pub fn proxy() -> (String, Bomb) {
122122
.build(&handle);
123123

124124
let record = Rc::new(RefCell::new(record));
125-
let srv = listener.incoming().for_each(|(socket, addr)| {
126-
Http::new().bind_connection(
127-
&handle,
125+
let srv = listener.incoming().for_each(|(socket, _addr)| {
126+
let conn = Http::<hyper::Chunk>::new().serve_connection(
128127
socket,
129-
addr,
130128
Proxy {
131129
sink: sink2.clone(),
132130
record: Rc::clone(&record),
133131
client: client.clone(),
134132
},
135133
);
134+
135+
let fut = conn.map(|_| ())
136+
.map_err(|e| eprintln!("server connection error: {}", e));
137+
handle.spawn(fut);
136138
Ok(())
137139
});
138140
drop(core.run(srv.select2(quitrx)));

0 commit comments

Comments
 (0)