nghttpx: Fix bug that END_STREAM is not set in backend for POST with Upgrade

This commit is contained in:
Tatsuhiro Tsujikawa 2015-05-26 00:00:11 +09:00
parent 7e51a87111
commit 326b4c467b
2 changed files with 5 additions and 4 deletions

View File

@ -928,13 +928,13 @@ void Downstream::inspect_http1_request() {
if (!upgrade_request_) {
auto idx = request_hdidx_[http2::HD_UPGRADE];
if (idx != -1) {
upgrade_request_ = true;
auto &val = request_headers_[idx].value;
// TODO Perform more strict checking for upgrade headers
if (util::streq_l(NGHTTP2_CLEARTEXT_PROTO_VERSION_ID, val.c_str(),
val.size())) {
http2_upgrade_seen_ = true;
} else {
upgrade_request_ = true;
}
}
}

View File

@ -80,10 +80,11 @@ public:
bool request_buf_full();
// Returns true if upgrade (HTTP Upgrade or CONNECT) is succeeded.
void check_upgrade_fulfilled();
// Returns true if the request is upgrade.
// Returns true if the request is upgrade. Upgrade to HTTP/2 is
// excluded. For HTTP/2 Upgrade, check get_http2_upgrade_request().
bool get_upgrade_request() const;
// Returns true if the upgrade is succeded as a result of the call
// check_upgrade_fulfilled().
// check_upgrade_fulfilled(). HTTP/2 Upgrade is excluded.
bool get_upgraded() const;
// Inspects HTTP/2 request.
void inspect_http2_request();