mirror of
https://github.com/actix/actix-web.git
synced 2024-11-26 19:41:12 +00:00
make HttpRequest::match_info_mut() public
This commit is contained in:
parent
2158ad29ee
commit
16c05f07ba
2 changed files with 9 additions and 8 deletions
|
@ -39,10 +39,8 @@ impl HttpResponseParser {
|
||||||
// if buf is empty parse_message will always return NotReady, let's avoid that
|
// if buf is empty parse_message will always return NotReady, let's avoid that
|
||||||
let read = if buf.is_empty() {
|
let read = if buf.is_empty() {
|
||||||
match utils::read_from_io(io, buf) {
|
match utils::read_from_io(io, buf) {
|
||||||
Ok(Async::Ready(0)) => {
|
Ok(Async::Ready(0)) =>
|
||||||
// debug!("Ignored premature client disconnection");
|
return Err(HttpResponseParserError::Disconnect),
|
||||||
return Err(HttpResponseParserError::Disconnect);
|
|
||||||
},
|
|
||||||
Ok(Async::Ready(_)) => (),
|
Ok(Async::Ready(_)) => (),
|
||||||
Ok(Async::NotReady) =>
|
Ok(Async::NotReady) =>
|
||||||
return Ok(Async::NotReady),
|
return Ok(Async::NotReady),
|
||||||
|
@ -66,10 +64,12 @@ impl HttpResponseParser {
|
||||||
}
|
}
|
||||||
if read || buf.remaining_mut() == 0 {
|
if read || buf.remaining_mut() == 0 {
|
||||||
match utils::read_from_io(io, buf) {
|
match utils::read_from_io(io, buf) {
|
||||||
Ok(Async::Ready(0)) => return Err(HttpResponseParserError::Disconnect),
|
Ok(Async::Ready(0)) =>
|
||||||
|
return Err(HttpResponseParserError::Disconnect),
|
||||||
Ok(Async::Ready(_)) => (),
|
Ok(Async::Ready(_)) => (),
|
||||||
Ok(Async::NotReady) => return Ok(Async::NotReady),
|
Ok(Async::NotReady) => return Ok(Async::NotReady),
|
||||||
Err(err) => return Err(HttpResponseParserError::Error(err.into())),
|
Err(err) =>
|
||||||
|
return Err(HttpResponseParserError::Error(err.into())),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Ok(Async::NotReady)
|
return Ok(Async::NotReady)
|
||||||
|
@ -109,7 +109,8 @@ impl HttpResponseParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_message(buf: &mut BytesMut) -> Poll<(ClientResponse, Option<Decoder>), ParseError>
|
fn parse_message(buf: &mut BytesMut)
|
||||||
|
-> Poll<(ClientResponse, Option<Decoder>), ParseError>
|
||||||
{
|
{
|
||||||
// Parse http message
|
// Parse http message
|
||||||
let bytes_ptr = buf.as_ref().as_ptr() as usize;
|
let bytes_ptr = buf.as_ref().as_ptr() as usize;
|
||||||
|
|
|
@ -365,7 +365,7 @@ impl<S> HttpRequest<S> {
|
||||||
|
|
||||||
/// Get mutable reference to request's Params.
|
/// Get mutable reference to request's Params.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn match_info_mut(&mut self) -> &mut Params {
|
pub fn match_info_mut(&mut self) -> &mut Params {
|
||||||
unsafe{ mem::transmute(&mut self.as_mut().params) }
|
unsafe{ mem::transmute(&mut self.as_mut().params) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue