mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 10:38:53 +08:00
nghttpx: Rename index_headers() as parse_content_length()
This commit is contained in:
@@ -367,7 +367,7 @@ void append_last_header_value(bool &key_prev, size_t &sum, Headers &headers,
|
|||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int FieldStore::index_headers() {
|
int FieldStore::parse_content_length() {
|
||||||
content_length = -1;
|
content_length = -1;
|
||||||
|
|
||||||
for (auto &kv : headers_) {
|
for (auto &kv : headers_) {
|
||||||
|
|||||||
@@ -89,10 +89,9 @@ public:
|
|||||||
|
|
||||||
bool header_key_prev() const { return header_key_prev_; }
|
bool header_key_prev() const { return header_key_prev_; }
|
||||||
|
|
||||||
// Lower the header field names and indexes header fields. If there
|
// Parses content-length, and records it in the field. If there are
|
||||||
// is any invalid headers (e.g., multiple Content-Length having
|
// multiple Content-Length, returns -1.
|
||||||
// different values), returns -1.
|
int parse_content_length();
|
||||||
int index_headers();
|
|
||||||
|
|
||||||
// Empties headers.
|
// Empties headers.
|
||||||
void clear_headers();
|
void clear_headers();
|
||||||
|
|||||||
@@ -572,7 +572,7 @@ int htp_hdrs_completecb(http_parser *htp) {
|
|||||||
resp.http_major = htp->http_major;
|
resp.http_major = htp->http_major;
|
||||||
resp.http_minor = htp->http_minor;
|
resp.http_minor = htp->http_minor;
|
||||||
|
|
||||||
if (resp.fs.index_headers() != 0) {
|
if (resp.fs.parse_content_length() != 0) {
|
||||||
downstream->set_response_state(Downstream::MSG_BAD_HEADER);
|
downstream->set_response_state(Downstream::MSG_BAD_HEADER);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ int htp_hdrs_completecb(http_parser *htp) {
|
|||||||
ULOG(INFO, upstream) << "HTTP request headers\n" << ss.str();
|
ULOG(INFO, upstream) << "HTTP request headers\n" << ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.fs.index_headers() != 0) {
|
if (req.fs.parse_content_length() != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ void on_ctrl_recv_callback(spdylay_session *session, spdylay_frame_type type,
|
|||||||
req.fs.add_header_token(name, value, false, token);
|
req.fs.add_header_token(name, value, false, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.fs.index_headers() != 0) {
|
if (req.fs.parse_content_length() != 0) {
|
||||||
if (upstream->error_reply(downstream, 400) != 0) {
|
if (upstream->error_reply(downstream, 400) != 0) {
|
||||||
ULOG(FATAL, upstream) << "error_reply failed";
|
ULOG(FATAL, upstream) << "error_reply failed";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user