1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

Merge branch 'master' into feature/allow_connection_timeout_to_be_set

This commit is contained in:
Glade Miller
2018-03-06 15:28:31 -07:00
committed by GitHub
49 changed files with 4365 additions and 167 deletions

View File

@ -12,3 +12,20 @@ pub use self::response::ClientResponse;
pub use self::connector::{Connect, Connection, ClientConnector, ClientConnectorError};
pub(crate) use self::writer::HttpClientWriter;
pub(crate) use self::parser::{HttpResponseParser, HttpResponseParserError};
use httpcodes;
use httpresponse::HttpResponse;
use error::ResponseError;
/// Convert `SendRequestError` to a `HttpResponse`
impl ResponseError for SendRequestError {
fn error_response(&self) -> HttpResponse {
match *self {
SendRequestError::Connector(_) => httpcodes::HttpBadGateway.into(),
_ => httpcodes::HttpInternalServerError.into(),
}
}
}

View File

@ -78,6 +78,7 @@ impl HttpResponseParser {
-> Poll<Option<Bytes>, PayloadError>
where T: IoStream
{
println!("PARSE payload, {:?}", self.decoder.is_some());
if self.decoder.is_some() {
loop {
// read payload