@@ -424,6 +424,16 @@ static void delete_http_req_spec(struct tfe_http_req_spec *req_spec)
|
||||
free((char *)req_spec->url);
|
||||
}
|
||||
|
||||
static void delete_http_resp_spec(struct tfe_http_resp_spec *resp_spec)
|
||||
{
|
||||
if (resp_spec->content_encoding)
|
||||
free((char *)resp_spec->content_encoding);
|
||||
if (resp_spec->content_type)
|
||||
free((char *)resp_spec->content_type);
|
||||
if (resp_spec->content_length)
|
||||
free((char *)resp_spec->content_length);
|
||||
}
|
||||
|
||||
void delete_stream_half_data(struct tfe_h2_half_private **data,
|
||||
int body_flag, enum tfe_conn_dir dir)
|
||||
{
|
||||
@@ -446,6 +456,12 @@ void delete_stream_half_data(struct tfe_h2_half_private **data,
|
||||
struct tfe_http_req_spec *req_spec = &((*data)->half_public.req_spec);
|
||||
delete_http_req_spec(req_spec);
|
||||
}
|
||||
if (dir == CONN_DIR_UPSTREAM)
|
||||
{
|
||||
struct tfe_http_resp_spec *resp_spec = &((*data)->half_public.resp_spec);
|
||||
delete_http_resp_spec(resp_spec);
|
||||
}
|
||||
|
||||
if((*data)->event_cb_user_deleter != NULL)
|
||||
(*data)->event_cb_user_deleter((*data)->event_cb_user);
|
||||
free(*data);
|
||||
@@ -1378,15 +1394,15 @@ fill_resp_spec_from_handle(struct tfe_h2_half_private *half_private)
|
||||
continue;
|
||||
}
|
||||
if (!strncmp((char *)(h2_field->nv.name), "content-type", strlen("content-type"))){
|
||||
resp_spec->content_type = (const char *)(h2_field->nv.value);
|
||||
resp_spec->content_type = tfe_strdup((const char *)(h2_field->nv.value));;
|
||||
continue;
|
||||
}
|
||||
if (!strncmp((char *)(h2_field->nv.name), "content-encoding", strlen("content-encoding"))){
|
||||
resp_spec->content_encoding = (const char *)(h2_field->nv.value);
|
||||
resp_spec->content_encoding = tfe_strdup((const char *)(h2_field->nv.value));;
|
||||
continue;
|
||||
}
|
||||
if (!strncmp((char *)(h2_field->nv.name), "content-length", strlen("content-length"))){
|
||||
resp_spec->content_length = (const char *)(h2_field->nv.value);
|
||||
resp_spec->content_length = tfe_strdup((const char *)(h2_field->nv.value));;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user