mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
re-eanble write backpressure for h1 connections
This commit is contained in:
parent
c5341017cd
commit
58a5d493b7
@ -1,5 +1,11 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## 0.3.3 (2018-01-xx)
|
||||||
|
|
||||||
|
* Stop processing any events after context stop
|
||||||
|
|
||||||
|
* Re-enable write back pressure for h1 connections
|
||||||
|
|
||||||
## 0.3.2 (2018-01-21)
|
## 0.3.2 (2018-01-21)
|
||||||
|
|
||||||
* Fix HEAD requests handling
|
* Fix HEAD requests handling
|
||||||
|
@ -18,7 +18,7 @@ use httprequest::HttpRequest;
|
|||||||
|
|
||||||
pub trait ActorHttpContext: 'static {
|
pub trait ActorHttpContext: 'static {
|
||||||
fn disconnected(&mut self);
|
fn disconnected(&mut self);
|
||||||
fn poll(&mut self) -> Poll<Option<SmallVec<[Frame; 2]>>, Error>;
|
fn poll(&mut self) -> Poll<Option<SmallVec<[Frame; 4]>>, Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -40,7 +40,7 @@ impl Frame {
|
|||||||
pub struct HttpContext<A, S=()> where A: Actor<Context=HttpContext<A, S>>,
|
pub struct HttpContext<A, S=()> where A: Actor<Context=HttpContext<A, S>>,
|
||||||
{
|
{
|
||||||
inner: ContextImpl<A>,
|
inner: ContextImpl<A>,
|
||||||
stream: Option<SmallVec<[Frame; 2]>>,
|
stream: Option<SmallVec<[Frame; 4]>>,
|
||||||
request: HttpRequest<S>,
|
request: HttpRequest<S>,
|
||||||
disconnected: bool,
|
disconnected: bool,
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ impl<A, S> ActorHttpContext for HttpContext<A, S> where A: Actor<Context=Self>,
|
|||||||
self.stop();
|
self.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn poll(&mut self) -> Poll<Option<SmallVec<[Frame; 2]>>, Error> {
|
fn poll(&mut self) -> Poll<Option<SmallVec<[Frame; 4]>>, Error> {
|
||||||
let ctx: &mut HttpContext<A, S> = unsafe {
|
let ctx: &mut HttpContext<A, S> = unsafe {
|
||||||
std::mem::transmute(self as &mut HttpContext<A, S>)
|
std::mem::transmute(self as &mut HttpContext<A, S>)
|
||||||
};
|
};
|
||||||
|
@ -179,7 +179,6 @@ impl<T: AsyncWrite> Writer for H1Writer<T> {
|
|||||||
if self.flags.contains(Flags::STARTED) {
|
if self.flags.contains(Flags::STARTED) {
|
||||||
// TODO: add warning, write after EOF
|
// TODO: add warning, write after EOF
|
||||||
self.encoder.write(payload)?;
|
self.encoder.write(payload)?;
|
||||||
return Ok(WriterState::Done)
|
|
||||||
} else {
|
} else {
|
||||||
// might be response to EXCEPT
|
// might be response to EXCEPT
|
||||||
self.buffer.extend_from_slice(payload.as_ref())
|
self.buffer.extend_from_slice(payload.as_ref())
|
||||||
|
@ -23,7 +23,7 @@ use ws::proto::{OpCode, CloseCode};
|
|||||||
pub struct WebsocketContext<A, S=()> where A: Actor<Context=WebsocketContext<A, S>>,
|
pub struct WebsocketContext<A, S=()> where A: Actor<Context=WebsocketContext<A, S>>,
|
||||||
{
|
{
|
||||||
inner: ContextImpl<A>,
|
inner: ContextImpl<A>,
|
||||||
stream: Option<SmallVec<[ContextFrame; 2]>>,
|
stream: Option<SmallVec<[ContextFrame; 4]>>,
|
||||||
request: HttpRequest<S>,
|
request: HttpRequest<S>,
|
||||||
disconnected: bool,
|
disconnected: bool,
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ impl<A, S> ActorHttpContext for WebsocketContext<A, S> where A: Actor<Context=Se
|
|||||||
self.stop();
|
self.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn poll(&mut self) -> Poll<Option<SmallVec<[ContextFrame;2]>>, Error> {
|
fn poll(&mut self) -> Poll<Option<SmallVec<[ContextFrame; 4]>>, Error> {
|
||||||
let ctx: &mut WebsocketContext<A, S> = unsafe {
|
let ctx: &mut WebsocketContext<A, S> = unsafe {
|
||||||
mem::transmute(self as &mut WebsocketContext<A, S>)
|
mem::transmute(self as &mut WebsocketContext<A, S>)
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user