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:
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user