Skip to content

Commit

Permalink
fix(server): fix debug assert failure when kept-alive connections see…
Browse files Browse the repository at this point in the history
… a parse error
  • Loading branch information
seanmonstar committed Jun 7, 2018
1 parent d7ab016 commit 396fe80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/proto/h1/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ where I: AsyncRead + AsyncWrite,
return Err(::Error::new_version_h2())
}
if let Some(msg) = T::on_error(&err) {
// Drop the cached headers so as to not trigger a debug
// assert in `write_head`...
self.state.cached_headers.take();
self.write_head(msg, None);
self.state.error = Some(err);
return Ok(());
Expand Down

0 comments on commit 396fe80

Please sign in to comment.