Commit 7a3c656a authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Refactor

parent 2a96d433
...@@ -665,7 +665,6 @@ int htp_hdrs_completecb(http_parser *htp) { ...@@ -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) { ...@@ -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
......
...@@ -341,13 +341,13 @@ void memcached_get_ticket_key_cb(struct ev_loop *loop, ev_timer *w, ...@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment