nghttp: Remove garbage for deprecated per-stream compression which cause leak
This commit is contained in:
parent
2bfa772472
commit
0cd26d6f3b
|
@ -428,13 +428,11 @@ struct HttpClient {
|
||||||
event *settings_timerev;
|
event *settings_timerev;
|
||||||
addrinfo *addrs;
|
addrinfo *addrs;
|
||||||
addrinfo *next_addr;
|
addrinfo *next_addr;
|
||||||
nghttp2_gzip *inflater;
|
|
||||||
// The number of completed requests, including failed ones.
|
// The number of completed requests, including failed ones.
|
||||||
size_t complete;
|
size_t complete;
|
||||||
// The length of settings_payload
|
// The length of settings_payload
|
||||||
size_t settings_payloadlen;
|
size_t settings_payloadlen;
|
||||||
client_state state;
|
client_state state;
|
||||||
int32_t last_inflate_error_stream_id;
|
|
||||||
// The HTTP status code of the response message of HTTP Upgrade.
|
// The HTTP status code of the response message of HTTP Upgrade.
|
||||||
unsigned int upgrade_response_status_code;
|
unsigned int upgrade_response_status_code;
|
||||||
// true if the response message of HTTP Upgrade request is fully
|
// true if the response message of HTTP Upgrade request is fully
|
||||||
|
@ -454,11 +452,9 @@ struct HttpClient {
|
||||||
settings_timerev(nullptr),
|
settings_timerev(nullptr),
|
||||||
addrs(nullptr),
|
addrs(nullptr),
|
||||||
next_addr(nullptr),
|
next_addr(nullptr),
|
||||||
inflater(nullptr),
|
|
||||||
complete(0),
|
complete(0),
|
||||||
settings_payloadlen(0),
|
settings_payloadlen(0),
|
||||||
state(STATE_IDLE),
|
state(STATE_IDLE),
|
||||||
last_inflate_error_stream_id(0),
|
|
||||||
upgrade_response_status_code(0),
|
upgrade_response_status_code(0),
|
||||||
upgrade_response_complete(false)
|
upgrade_response_complete(false)
|
||||||
{}
|
{}
|
||||||
|
@ -919,38 +915,6 @@ struct HttpClient {
|
||||||
stat.on_handshake_time = get_time();
|
stat.on_handshake_time = get_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool check_inflater(int32_t stream_id)
|
|
||||||
{
|
|
||||||
if(inflater == nullptr || last_inflate_error_stream_id == stream_id) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
last_inflate_error_stream_id = 0;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool reset_inflater()
|
|
||||||
{
|
|
||||||
int rv;
|
|
||||||
nghttp2_gzip *gzip;
|
|
||||||
|
|
||||||
if(inflater) {
|
|
||||||
nghttp2_gzip_inflate_del(inflater);
|
|
||||||
inflater = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
rv = nghttp2_gzip_inflate_new(&gzip);
|
|
||||||
|
|
||||||
if(rv != 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inflater = gzip;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_request(Request *req)
|
void on_request(Request *req)
|
||||||
{
|
{
|
||||||
req->record_request_time();
|
req->record_request_time();
|
||||||
|
@ -1685,10 +1649,6 @@ int communicate(const std::string& scheme, const std::string& host,
|
||||||
{
|
{
|
||||||
HttpClient client{callbacks, evbase, ssl_ctx};
|
HttpClient client{callbacks, evbase, ssl_ctx};
|
||||||
|
|
||||||
if(!client.reset_inflater()) {
|
|
||||||
goto fin;
|
|
||||||
}
|
|
||||||
|
|
||||||
nghttp2_priority_spec pri_spec;
|
nghttp2_priority_spec pri_spec;
|
||||||
|
|
||||||
if(config.weight != NGHTTP2_DEFAULT_WEIGHT) {
|
if(config.weight != NGHTTP2_DEFAULT_WEIGHT) {
|
||||||
|
|
Loading…
Reference in New Issue