Module: kamailio Branch: master Commit: 34ffef464fbb26c3526990a0bf8b9c5d1cd4ee97 URL: https://github.com/kamailio/kamailio/commit/34ffef464fbb26c3526990a0bf8b9c5d...
Author: Olle E. Johansson oej@edvina.net Committer: Olle E. Johansson oej@edvina.net Date: 2016-03-28T11:54:53+02:00
http_client Debug http_proxy and add http_proxy usage to the http_client_query function
---
Modified: modules/http_client/functions.c
---
Diff: https://github.com/kamailio/kamailio/commit/34ffef464fbb26c3526990a0bf8b9c5d... Patch: https://github.com/kamailio/kamailio/commit/34ffef464fbb26c3526990a0bf8b9c5d...
---
diff --git a/modules/http_client/functions.c b/modules/http_client/functions.c index 3068176..dc75042 100644 --- a/modules/http_client/functions.c +++ b/modules/http_client/functions.c @@ -183,8 +183,11 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, const }
if (params->http_proxy != NULL) { + LM_DBG("****** ##### CURL proxy [%s] \n", params->http_proxy); res |= curl_easy_setopt(curl, CURLOPT_PROXY, params->http_proxy); - } + } else { + LM_DBG("****** ##### CURL proxy NOT SET \n"); + }
if (params->http_proxy_port > 0) { res |= curl_easy_setopt(curl, CURLOPT_PROXYPORT, params->http_proxy_port); @@ -379,7 +382,12 @@ int curl_con_query_url(struct sip_msg* _m, const str *connection, const str* url query_params.oneline = 0; query_params.maxdatasize = maxdatasize; query_params.http_proxy_port = conn->http_proxy_port; - query_params.http_proxy = conn->http_proxy; + if (conn->http_proxy) { + query_params.http_proxy = conn->http_proxy; + LM_DBG("****** ##### CURL proxy [%s] \n", query_params.http_proxy); + } else { + LM_DBG("**** Curl HTTP_proxy not set \n"); + }
res = curL_query_url(_m, urlbuf, result, &query_params);
@@ -421,6 +429,8 @@ int http_query(struct sip_msg* _m, char* _url, str* _dst, char* _post) query_params.http_follow_redirect = default_http_follow_redirect; query_params.oneline = 1; query_params.maxdatasize = 0; + query_params.http_proxy = as_asciiz(&default_http_proxy); + query_params.http_proxy_port = default_http_proxy_port;
res = curL_query_url(_m, _url, _dst, &query_params);