mirror of https://github.com/fafhrd91/actix-web
add comment for None variant output of MessageType::decode for Request
This commit is contained in:
parent
a3fd266629
commit
3eca681cc2
|
@ -208,8 +208,9 @@ impl MessageType for Request {
|
|||
trace!("MAX_BUFFER_SIZE unprocessed data reached, closing");
|
||||
Err(ParseError::TooLarge)
|
||||
} else {
|
||||
// Return None to notify more read are needed for parsing request
|
||||
Ok(None)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -277,14 +278,16 @@ impl MessageType for ResponseHead {
|
|||
|
||||
(len, version, status, res.headers.len())
|
||||
}
|
||||
httparse::Status::Partial => return {
|
||||
httparse::Status::Partial => {
|
||||
return {
|
||||
if src.len() >= MAX_BUFFER_SIZE {
|
||||
error!("MAX_BUFFER_SIZE unprocessed data reached, closing");
|
||||
Err(ParseError::TooLarge)
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -609,6 +609,8 @@ where
|
|||
}
|
||||
}
|
||||
}
|
||||
// decode is partial and buffer is not full yet.
|
||||
// break and wait for more read.
|
||||
Ok(None) => break,
|
||||
Err(ParseError::Io(e)) => {
|
||||
self.as_mut().client_disconnected();
|
||||
|
|
Loading…
Reference in New Issue