nghttpx: HttpsUpdatem: Don't send error_page if response state is MSG_COMPLETE

This commit is contained in:
Tatsuhiro Tsujikawa 2015-02-20 01:24:42 +09:00
parent 512aa8942a
commit 6657966334
1 changed files with 5 additions and 0 deletions

View File

@ -296,6 +296,7 @@ int HttpsUpstream::on_read() {
} }
} }
// http_parser_execute() does nothing once it entered error state.
auto nread = http_parser_execute( auto nread = http_parser_execute(
&htp_, &htp_hooks, reinterpret_cast<const char *>(rb->pos), rb->rleft()); &htp_, &htp_hooks, reinterpret_cast<const char *>(rb->pos), rb->rleft());
@ -349,6 +350,10 @@ int HttpsUpstream::on_read() {
} }
if (htperr != HPE_OK) { if (htperr != HPE_OK) {
if (downstream->get_response_state() == Downstream::MSG_COMPLETE) {
return 0;
}
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
ULOG(INFO, this) << "HTTP parse failure: " ULOG(INFO, this) << "HTTP parse failure: "
<< "(" << http_errno_name(htperr) << ") " << "(" << http_errno_name(htperr) << ") "