From 18dd20ce552f51c3fb160bb7d643cc9865ee1fa0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 28 Jun 2017 01:00:01 +0900 Subject: [PATCH] nghttp: Fix bug that upgrade fails if reason-phrase is missing --- src/nghttp.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index 2aec0eda..47fc5127 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -404,17 +404,10 @@ int htp_msg_begincb(http_parser *htp) { } } // namespace -namespace { -int htp_statuscb(http_parser *htp, const char *at, size_t length) { - auto client = static_cast(htp->data); - client->upgrade_response_status_code = htp->status_code; - return 0; -} -} // namespace - namespace { int htp_msg_completecb(http_parser *htp) { auto client = static_cast(htp->data); + client->upgrade_response_status_code = htp->status_code; client->upgrade_response_complete = true; return 0; } @@ -424,7 +417,7 @@ namespace { constexpr http_parser_settings htp_hooks = { htp_msg_begincb, // http_cb on_message_begin; nullptr, // http_data_cb on_url; - htp_statuscb, // http_data_cb on_status; + nullptr, // http_data_cb on_status; nullptr, // http_data_cb on_header_field; nullptr, // http_data_cb on_header_value; nullptr, // http_cb on_headers_complete;