nghttpx: Remove unused noop function
This commit is contained in:
parent
c3aa02f003
commit
b11e1afc91
12
src/http2.cc
12
src/http2.cc
|
@ -156,17 +156,6 @@ bool lws(const char *value) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sanitize_header_value(std::string &s, size_t offset) {
|
|
||||||
// Since both nghttp2 and spdylay do not allow \n and \r in header
|
|
||||||
// values, we don't have to do this anymore.
|
|
||||||
|
|
||||||
// for(size_t i = offset, eoi = s.size(); i < eoi; ++i) {
|
|
||||||
// if(s[i] == '\r' || s[i] == '\n') {
|
|
||||||
// s[i] = ' ';
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
void copy_url_component(std::string &dest, const http_parser_url *u, int field,
|
void copy_url_component(std::string &dest, const http_parser_url *u, int field,
|
||||||
const char *url) {
|
const char *url) {
|
||||||
if (u->field_set & (1 << field)) {
|
if (u->field_set & (1 << field)) {
|
||||||
|
@ -275,7 +264,6 @@ void build_http1_headers_from_headers(std::string &hdrs,
|
||||||
capitalize(hdrs, hdrs.size() - kv.name.size());
|
capitalize(hdrs, hdrs.size() - kv.name.size());
|
||||||
hdrs += ": ";
|
hdrs += ": ";
|
||||||
hdrs += kv.value;
|
hdrs += kv.value;
|
||||||
sanitize_header_value(hdrs, hdrs.size() - kv.value.size());
|
|
||||||
hdrs += "\r\n";
|
hdrs += "\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,6 @@ void capitalize(std::string &s, size_t offset);
|
||||||
// Returns true if |value| is LWS
|
// Returns true if |value| is LWS
|
||||||
bool lws(const char *value);
|
bool lws(const char *value);
|
||||||
|
|
||||||
void sanitize_header_value(std::string &s, size_t offset);
|
|
||||||
|
|
||||||
// Copies the |field| component value from |u| and |url| to the
|
// Copies the |field| component value from |u| and |url| to the
|
||||||
// |dest|. If |u| does not have |field|, then this function does
|
// |dest|. If |u| does not have |field|, then this function does
|
||||||
// nothing.
|
// nothing.
|
||||||
|
|
|
@ -287,7 +287,6 @@ int HttpDownstreamConnection::push_request_headers() {
|
||||||
hdrs += "X-Forwarded-For: ";
|
hdrs += "X-Forwarded-For: ";
|
||||||
if (xff && !get_config()->strip_incoming_x_forwarded_for) {
|
if (xff && !get_config()->strip_incoming_x_forwarded_for) {
|
||||||
hdrs += (*xff).value;
|
hdrs += (*xff).value;
|
||||||
http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size());
|
|
||||||
hdrs += ", ";
|
hdrs += ", ";
|
||||||
}
|
}
|
||||||
hdrs += client_handler_->get_ipaddr();
|
hdrs += client_handler_->get_ipaddr();
|
||||||
|
@ -295,7 +294,6 @@ int HttpDownstreamConnection::push_request_headers() {
|
||||||
} else if (xff && !get_config()->strip_incoming_x_forwarded_for) {
|
} else if (xff && !get_config()->strip_incoming_x_forwarded_for) {
|
||||||
hdrs += "X-Forwarded-For: ";
|
hdrs += "X-Forwarded-For: ";
|
||||||
hdrs += (*xff).value;
|
hdrs += (*xff).value;
|
||||||
http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size());
|
|
||||||
hdrs += "\r\n";
|
hdrs += "\r\n";
|
||||||
}
|
}
|
||||||
if (!get_config()->http2_proxy && !get_config()->client_proxy &&
|
if (!get_config()->http2_proxy && !get_config()->client_proxy &&
|
||||||
|
@ -314,7 +312,6 @@ int HttpDownstreamConnection::push_request_headers() {
|
||||||
if (expect && !util::strifind((*expect).value.c_str(), "100-continue")) {
|
if (expect && !util::strifind((*expect).value.c_str(), "100-continue")) {
|
||||||
hdrs += "Expect: ";
|
hdrs += "Expect: ";
|
||||||
hdrs += (*expect).value;
|
hdrs += (*expect).value;
|
||||||
http2::sanitize_header_value(hdrs, hdrs.size() - (*expect).value.size());
|
|
||||||
hdrs += "\r\n";
|
hdrs += "\r\n";
|
||||||
}
|
}
|
||||||
auto via = downstream_->get_request_header(http2::HD_VIA);
|
auto via = downstream_->get_request_header(http2::HD_VIA);
|
||||||
|
@ -322,14 +319,12 @@ int HttpDownstreamConnection::push_request_headers() {
|
||||||
if (via) {
|
if (via) {
|
||||||
hdrs += "Via: ";
|
hdrs += "Via: ";
|
||||||
hdrs += (*via).value;
|
hdrs += (*via).value;
|
||||||
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
|
|
||||||
hdrs += "\r\n";
|
hdrs += "\r\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hdrs += "Via: ";
|
hdrs += "Via: ";
|
||||||
if (via) {
|
if (via) {
|
||||||
hdrs += (*via).value;
|
hdrs += (*via).value;
|
||||||
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
|
|
||||||
hdrs += ", ";
|
hdrs += ", ";
|
||||||
}
|
}
|
||||||
hdrs += http::create_via_header_value(downstream_->get_request_major(),
|
hdrs += http::create_via_header_value(downstream_->get_request_major(),
|
||||||
|
|
|
@ -705,14 +705,12 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream) {
|
||||||
if (via) {
|
if (via) {
|
||||||
hdrs += "Via: ";
|
hdrs += "Via: ";
|
||||||
hdrs += (*via).value;
|
hdrs += (*via).value;
|
||||||
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
|
|
||||||
hdrs += "\r\n";
|
hdrs += "\r\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hdrs += "Via: ";
|
hdrs += "Via: ";
|
||||||
if (via) {
|
if (via) {
|
||||||
hdrs += (*via).value;
|
hdrs += (*via).value;
|
||||||
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
|
|
||||||
hdrs += ", ";
|
hdrs += ", ";
|
||||||
}
|
}
|
||||||
hdrs += http::create_via_header_value(downstream->get_response_major(),
|
hdrs += http::create_via_header_value(downstream->get_response_major(),
|
||||||
|
|
Loading…
Reference in New Issue