nghttpx: Fix location rewrite is failed because request headers are empty

Previously we empties request headers after they are sent to
downstream in order to free memory.  But it turns out that we use
request headers when rewriting location header response field.  Also
user reported that request headers are useful to add new features.
This commits defers the deletion of request headers to the point when
response headers are deleted (which is after response headers are sent
to upstream client).
This commit is contained in:
Tatsuhiro Tsujikawa 2014-08-27 21:25:25 +09:00
parent 70a8fd59b1
commit 0209b7c083
5 changed files with 3 additions and 3 deletions

View File

@ -466,7 +466,6 @@ int Http2DownstreamConnection::push_request_headers()
return -1;
}
downstream_->clear_request_headers();
downstream_->reset_downstream_wtimer();
http2session_->notify();

View File

@ -1306,6 +1306,7 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream)
}
downstream->clear_response_headers();
downstream->clear_request_headers();
return 0;
}

View File

@ -297,8 +297,6 @@ int HttpDownstreamConnection::push_request_headers()
&get_config()->downstream_read_timeout,
&get_config()->downstream_write_timeout);
downstream_->clear_request_headers();
return 0;
}

View File

@ -877,6 +877,7 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream)
}
downstream->clear_response_headers();
downstream->clear_request_headers();
return 0;
}

View File

@ -1013,6 +1013,7 @@ int SpdyUpstream::on_downstream_header_complete(Downstream *downstream)
}
downstream->clear_response_headers();
downstream->clear_request_headers();
return 0;
}