Skip to content

Commit ebf8d7f

Browse files
committed
Fix back-pressure handling for concurrent connections
1 parent 298727d commit ebf8d7f

File tree

8 files changed

+22
-15
lines changed

8 files changed

+22
-15
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes
22

3+
## [0.2.6] - 2018-12-21
4+
5+
### Fixed
6+
7+
* Fix back-pressure handling for concurrent connections
8+
9+
310
## [0.2.5] - 2018-12-12
411

512
### Fixed

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "actix-net"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
authors = ["Nikolay Kim <[email protected]>"]
55
description = "Actix net - framework for the compisible network services for Rust (experimental)"
66
readme = "README.md"
@@ -58,8 +58,7 @@ tokio-timer = "0.2"
5858
tokio-reactor = "0.1"
5959
tokio-current-thread = "0.1"
6060
tower-service = "0.1"
61-
trust-dns-proto = "^0.5.0"
62-
trust-dns-resolver = "^0.10.0"
61+
trust-dns-resolver = "^0.10.2"
6362

6463
# native-tls
6564
native-tls = { version="0.2", optional = true }

examples/basic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ fn main() {
8080
future::ok(())
8181
})
8282
},
83-
).unwrap()
83+
)
84+
.unwrap()
8485
.start();
8586

8687
sys.run();

examples/ssl.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ fn main() {
6161
println!("got ssl connection {:?}", num);
6262
future::ok(())
6363
})
64-
}).unwrap()
64+
})
65+
.unwrap()
6566
.start();
6667

6768
sys.run();

src/codec/framed_write.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ where
254254
io::ErrorKind::WriteZero,
255255
"failed to \
256256
write frame to transport",
257-
).into());
257+
)
258+
.into());
258259
}
259260

260261
// TODO: Add a way to `bytes` to do this w/o returning the drained

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99

1010
#![cfg_attr(
1111
feature = "cargo-clippy",
12-
allow(
13-
declare_interior_mutable_const,
14-
borrow_interior_mutable_const
15-
)
12+
allow(declare_interior_mutable_const, borrow_interior_mutable_const)
1613
)]
1714

1815
#[macro_use]

src/server/services.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ where
8383
});
8484

8585
if let Ok(stream) = stream {
86-
spawn(self.service.call(stream).map_err(|_| ()).map(move |val| {
86+
spawn(self.service.call(stream).then(move |res| {
8787
drop(guard);
88-
val
88+
res.map_err(|_| ())
8989
}));
9090
ok(())
9191
} else {
@@ -123,9 +123,9 @@ where
123123
}
124124

125125
fn call(&mut self, (guard, req): (Option<CounterGuard>, ServerMessage)) -> Self::Future {
126-
spawn(self.service.call(req).map_err(|_| ()).map(move |val| {
126+
spawn(self.service.call(req).then(move |res| {
127127
drop(guard);
128-
val
128+
res.map_err(|_| ())
129129
}));
130130
ok(())
131131
}

src/server/worker.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ impl Worker {
167167
.map_err(|e| {
168168
error!("Can not start worker: {:?}", e);
169169
Arbiter::current().do_send(StopArbiter(0));
170-
}).and_then(move |services| {
170+
})
171+
.and_then(move |services| {
171172
for item in services {
172173
for (idx, token, service) in item {
173174
while token.0 >= wrk.services.len() {

0 commit comments

Comments
 (0)