mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-30 18:34:36 +01:00
flush io on complete
This commit is contained in:
parent
992f7a11b3
commit
8eb9eb4247
@ -337,9 +337,10 @@ impl<T: AsyncWrite, H: 'static> Writer for H1Writer<T, H> {
|
||||
}
|
||||
}
|
||||
if shutdown {
|
||||
self.stream.poll_flush()?;
|
||||
self.stream.shutdown()
|
||||
} else {
|
||||
Ok(Async::Ready(()))
|
||||
self.stream.poll_flush()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ impl Ws2 {
|
||||
ctx.drain()
|
||||
.and_then(|_, act, ctx| {
|
||||
act.count += 1;
|
||||
if act.count != 1_000 {
|
||||
if act.count != 10_000 {
|
||||
act.send(ctx);
|
||||
}
|
||||
actix::fut::ok(())
|
||||
@ -248,7 +248,7 @@ fn test_server_send_text() {
|
||||
});
|
||||
let (mut reader, _writer) = srv.ws().unwrap();
|
||||
|
||||
for _ in 0..1_000 {
|
||||
for _ in 0..10_000 {
|
||||
let (item, r) = srv.execute(reader.into_future()).unwrap();
|
||||
reader = r;
|
||||
assert_eq!(item, data);
|
||||
@ -272,7 +272,7 @@ fn test_server_send_bin() {
|
||||
});
|
||||
let (mut reader, _writer) = srv.ws().unwrap();
|
||||
|
||||
for _ in 0..1_000 {
|
||||
for _ in 0..10_000 {
|
||||
let (item, r) = srv.execute(reader.into_future()).unwrap();
|
||||
reader = r;
|
||||
assert_eq!(item, data);
|
||||
@ -308,7 +308,7 @@ fn test_ws_server_ssl() {
|
||||
let (mut reader, _writer) = srv.ws().unwrap();
|
||||
|
||||
let data = Some(ws::Message::Text("0".repeat(65_536)));
|
||||
for _ in 0..1_000 {
|
||||
for _ in 0..10_000 {
|
||||
let (item, r) = srv.execute(reader.into_future()).unwrap();
|
||||
reader = r;
|
||||
assert_eq!(item, data);
|
||||
@ -347,7 +347,7 @@ fn test_ws_server_rust_tls() {
|
||||
let (mut reader, _writer) = srv.ws().unwrap();
|
||||
|
||||
let data = Some(ws::Message::Text("0".repeat(65_536)));
|
||||
for _ in 0..1_000 {
|
||||
for _ in 0..10_000 {
|
||||
let (item, r) = srv.execute(reader.into_future()).unwrap();
|
||||
reader = r;
|
||||
assert_eq!(item, data);
|
||||
|
Loading…
Reference in New Issue
Block a user