nghttpx: Remove unused noop function

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-15 23:14:00 +09:00
parent c3aa02f003
commit b11e1afc91
4 changed files with 0 additions and 21 deletions

View File

@ -156,17 +156,6 @@ bool lws(const char *value) {
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,
const char *url) {
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());
hdrs += ": ";
hdrs += kv.value;
sanitize_header_value(hdrs, hdrs.size() - kv.value.size());
hdrs += "\r\n";
}
}

View File

@ -68,8 +68,6 @@ void capitalize(std::string &s, size_t offset);
// Returns true if |value| is LWS
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
// |dest|. If |u| does not have |field|, then this function does
// nothing.

View File

@ -287,7 +287,6 @@ int HttpDownstreamConnection::push_request_headers() {
hdrs += "X-Forwarded-For: ";
if (xff && !get_config()->strip_incoming_x_forwarded_for) {
hdrs += (*xff).value;
http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size());
hdrs += ", ";
}
hdrs += client_handler_->get_ipaddr();
@ -295,7 +294,6 @@ int HttpDownstreamConnection::push_request_headers() {
} else if (xff && !get_config()->strip_incoming_x_forwarded_for) {
hdrs += "X-Forwarded-For: ";
hdrs += (*xff).value;
http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size());
hdrs += "\r\n";
}
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")) {
hdrs += "Expect: ";
hdrs += (*expect).value;
http2::sanitize_header_value(hdrs, hdrs.size() - (*expect).value.size());
hdrs += "\r\n";
}
auto via = downstream_->get_request_header(http2::HD_VIA);
@ -322,14 +319,12 @@ int HttpDownstreamConnection::push_request_headers() {
if (via) {
hdrs += "Via: ";
hdrs += (*via).value;
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
hdrs += "\r\n";
}
} else {
hdrs += "Via: ";
if (via) {
hdrs += (*via).value;
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
hdrs += ", ";
}
hdrs += http::create_via_header_value(downstream_->get_request_major(),

View File

@ -705,14 +705,12 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream) {
if (via) {
hdrs += "Via: ";
hdrs += (*via).value;
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
hdrs += "\r\n";
}
} else {
hdrs += "Via: ";
if (via) {
hdrs += (*via).value;
http2::sanitize_header_value(hdrs, hdrs.size() - (*via).value.size());
hdrs += ", ";
}
hdrs += http::create_via_header_value(downstream->get_response_major(),