From cdf0633b6b51bbfb7eb785715358c88aeb4c6a40 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 8 Apr 2024 14:14:58 +0200 Subject: [PATCH] http_client: added http_client_response_headers_clear() - clear response headers - if not explicitely done, it happens when next http request is performed --- src/modules/http_client/http_client.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c index c8af2f64901..27310829d0e 100644 --- a/src/modules/http_client/http_client.c +++ b/src/modules/http_client/http_client.c @@ -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); @@ -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} }; @@ -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 */