Merge branch 'master' into master

This commit is contained in:
Nikolay Kim 2019-05-04 08:41:24 -07:00 committed by GitHub
commit 2c8c49e0c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View File

@ -1,5 +1,12 @@
# Changes # Changes
## [0.1.5] - 2019-05-xx
### Fixed
* Clean up response extensions in response pool #817
## [0.1.4] - 2019-04-24 ## [0.1.4] - 2019-04-24
### Added ### Added

View File

@ -137,7 +137,7 @@ impl<E: ResponseError> ResponseError for TimeoutError<E> {
#[display(fmt = "UnknownError")] #[display(fmt = "UnknownError")]
struct UnitError; struct UnitError;
/// `InternalServerError` for `JsonError` /// `InternalServerError` for `UnitError`
impl ResponseError for UnitError {} impl ResponseError for UnitError {}
/// `InternalServerError` for `JsonError` /// `InternalServerError` for `JsonError`
@ -150,11 +150,11 @@ impl ResponseError for FormError {}
impl ResponseError for TimerError {} impl ResponseError for TimerError {}
#[cfg(feature = "ssl")] #[cfg(feature = "ssl")]
/// `InternalServerError` for `SslError` /// `InternalServerError` for `openssl::ssl::Error`
impl ResponseError for openssl::ssl::Error {} impl ResponseError for openssl::ssl::Error {}
#[cfg(feature = "ssl")] #[cfg(feature = "ssl")]
/// `InternalServerError` for `SslError` /// `InternalServerError` for `openssl::ssl::HandshakeError`
impl ResponseError for openssl::ssl::HandshakeError<tokio_tcp::TcpStream> {} impl ResponseError for openssl::ssl::HandshakeError<tokio_tcp::TcpStream> {}
/// Return `BAD_REQUEST` for `de::value::Error` /// Return `BAD_REQUEST` for `de::value::Error`

View File

@ -449,6 +449,7 @@ impl BoxedResponsePool {
fn release(&self, msg: Box<ResponseHead>) { fn release(&self, msg: Box<ResponseHead>) {
let v = &mut self.0.borrow_mut(); let v = &mut self.0.borrow_mut();
if v.len() < 128 { if v.len() < 128 {
msg.extensions.borrow_mut().clear();
v.push(msg); v.push(msg);
} }
} }

View File

@ -65,7 +65,7 @@ pub enum JsonPayloadError {
Payload(PayloadError), Payload(PayloadError),
} }
/// Return `InternlaServerError` for `JsonPayloadError` /// Return `InternalServerError` for `JsonPayloadError`
impl ResponseError for JsonPayloadError { impl ResponseError for JsonPayloadError {
fn error_response(&self) -> Response { fn error_response(&self) -> Response {
Response::new(StatusCode::INTERNAL_SERVER_ERROR) Response::new(StatusCode::INTERNAL_SERVER_ERROR)