nghttpx: Refactor

This commit is contained in:
Tatsuhiro Tsujikawa 2016-05-15 21:05:20 +09:00
parent 2a96d433ec
commit 7a3c656adf
2 changed files with 4 additions and 8 deletions

View File

@ -665,7 +665,6 @@ int htp_hdrs_completecb(http_parser *htp) {
} }
} }
auto status = resp.http_status;
// Ignore the response body. HEAD response may contain // Ignore the response body. HEAD response may contain
// Content-Length or Transfer-Encoding: chunked. Some server send // Content-Length or Transfer-Encoding: chunked. Some server send
// 304 status code with nonzero Content-Length, but without response // 304 status code with nonzero Content-Length, but without response
@ -674,10 +673,7 @@ int htp_hdrs_completecb(http_parser *htp) {
// TODO It seems that the cases other than HEAD are handled by // TODO It seems that the cases other than HEAD are handled by
// http-parser. Need test. // http-parser. Need test.
return req.method == HTTP_HEAD || (100 <= status && status <= 199) || return !http2::expect_response_body(req.method, resp.http_status);
status == 204 || status == 304
? 1
: 0;
} }
} // namespace } // namespace

View File

@ -341,13 +341,13 @@ void memcached_get_ticket_key_cb(struct ev_loop *loop, ev_timer *w,
key.hmac = EVP_sha256(); key.hmac = EVP_sha256();
key.hmac_keylen = hmac_keylen; key.hmac_keylen = hmac_keylen;
std::copy_n(p, key.data.name.size(), key.data.name.data()); std::copy_n(p, key.data.name.size(), std::begin(key.data.name));
p += key.data.name.size(); p += key.data.name.size();
std::copy_n(p, enc_keylen, key.data.enc_key.data()); std::copy_n(p, enc_keylen, std::begin(key.data.enc_key));
p += enc_keylen; p += enc_keylen;
std::copy_n(p, hmac_keylen, key.data.hmac_key.data()); std::copy_n(p, hmac_keylen, std::begin(key.data.hmac_key));
p += hmac_keylen; p += hmac_keylen;
ticket_keys->keys.push_back(std::move(key)); ticket_keys->keys.push_back(std::move(key));