1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-30 18:34:36 +01:00

fix failing requests to test server #508

This commit is contained in:
Nikolay Kim 2018-09-11 11:24:05 -07:00
parent 513c8ec1ce
commit 70a3f317d3
3 changed files with 10 additions and 8 deletions

View File

@ -1,11 +1,14 @@
# Changes # Changes
## [0.7.7] - 2018-09-xx ## [0.7.7] - 2018-09-11
### Fixed ### Fixed
* Fix linked list of HttpChannels #504 * Fix linked list of HttpChannels #504
* Fix requests to TestServer fail #508
## [0.7.6] - 2018-09-07 ## [0.7.6] - 2018-09-07
### Fixed ### Fixed

View File

@ -1,6 +1,6 @@
[package] [package]
name = "actix-web" name = "actix-web"
version = "0.7.6" version = "0.7.7"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"] authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust." description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust."
readme = "README.md" readme = "README.md"

View File

@ -3,12 +3,11 @@ use std::rc::Rc;
use std::sync::Arc; use std::sync::Arc;
use std::{io, mem, net, time}; use std::{io, mem, net, time};
use actix::{Actor, Addr, AsyncContext, Context, Handler, System}; use actix::{Arbiter, Actor, Addr, AsyncContext, Context, Handler, System};
use futures::{Future, Stream}; use futures::{Future, Stream};
use net2::{TcpBuilder, TcpStreamExt}; use net2::{TcpBuilder, TcpStreamExt};
use num_cpus; use num_cpus;
use tokio_current_thread::spawn;
use tokio_io::{AsyncRead, AsyncWrite}; use tokio_io::{AsyncRead, AsyncWrite};
use tokio_tcp::TcpStream; use tokio_tcp::TcpStream;
@ -585,7 +584,7 @@ where
type Result = (); type Result = ();
fn handle(&mut self, msg: Conn<T>, _: &mut Context<Self>) -> Self::Result { fn handle(&mut self, msg: Conn<T>, _: &mut Context<Self>) -> Self::Result {
spawn(HttpChannel::new( Arbiter::spawn(HttpChannel::new(
Rc::clone(&self.settings), Rc::clone(&self.settings),
msg.io, msg.io,
msg.peer, msg.peer,
@ -693,7 +692,7 @@ where
}; };
let _ = io.set_nodelay(true); let _ = io.set_nodelay(true);
spawn(HttpChannel::new(h, io, peer)); Arbiter::spawn(HttpChannel::new(h, io, peer));
} }
} }
@ -753,10 +752,10 @@ where
let _ = io.set_nodelay(true); let _ = io.set_nodelay(true);
let rate = h.connection_rate(); let rate = h.connection_rate();
spawn(self.acceptor.accept(io).then(move |res| { Arbiter::spawn(self.acceptor.accept(io).then(move |res| {
drop(rate); drop(rate);
match res { match res {
Ok(io) => spawn(HttpChannel::new(h, io, peer)), Ok(io) => Arbiter::spawn(HttpChannel::new(h, io, peer)),
Err(err) => trace!("Can not establish connection: {}", err), Err(err) => trace!("Can not establish connection: {}", err),
} }
Ok(()) Ok(())