Skip to content

Commit

Permalink
http_client: added http_client_response_headers_clear()
Browse files Browse the repository at this point in the history
- clear response headers
- if not explicitely done, it happens when next http request is
  performed
  • Loading branch information
miconda committed Apr 8, 2024
1 parent 60ded00 commit cdf0633
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/modules/http_client/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ static int w_http_query_request_v2pk(struct sip_msg *_m, char *_met, char *_url,
char *_body, char *_hdrs, char *_result);
static int w_http_client_response_headers_set(
sip_msg_t *_m, char *_pval, char *_p2);
static int w_http_client_response_headers_clear(
sip_msg_t *_m, char *_p1, char *_p2);

/* forward function */
static int curl_con_param(modparam_t type, void *val);
Expand Down Expand Up @@ -205,6 +207,9 @@ static cmd_export_t cmds[] = {
{"http_client_response_headers_set",
(cmd_function)w_http_client_response_headers_set, 1, fixup_igp_null,
fixup_free_igp_null, ANY_ROUTE},
{"http_client_response_headers_clear",
(cmd_function)w_http_client_response_headers_clear, 1, 0,
0, ANY_ROUTE},
{"bind_http_client", (cmd_function)bind_httpc_api, 0, 0, 0, 0},
{0,0,0,0,0,0}
};
Expand Down Expand Up @@ -1184,6 +1189,16 @@ static int w_http_client_response_headers_set(
return ki_http_client_response_headers_set(_m, ival);
}

/*!
*
*/
static int w_http_client_response_headers_clear(
sip_msg_t *_m, char *_pval, char *_p2)
{
http_client_response_headers_reset();
return 1;
}

/*!
* Parse arguments to pv $curlerror
*/
Expand Down

0 comments on commit cdf0633

Please sign in to comment.