[sr-dev] git:4.4:37e59b5d: http_client Debug http_proxy and add http_proxy usage to the http_client_query function

Olle E. Johansson oej at edvina.net
Wed Mar 30 08:56:35 CEST 2016


Module: kamailio
Branch: 4.4
Commit: 37e59b5d1d3d12a2358d24fc5e37f2f55ee2e41a
URL: https://github.com/kamailio/kamailio/commit/37e59b5d1d3d12a2358d24fc5e37f2f55ee2e41a

Author: Olle E. Johansson <oej at edvina.net>
Committer: Olle E. Johansson <oej at edvina.net>
Date: 2016-03-30T08:56:25+02:00

http_client Debug http_proxy and add http_proxy usage to the http_client_query function

(cherry picked from commit 34ffef464fbb26c3526990a0bf8b9c5d1cd4ee97)

---

Modified: modules/http_client/functions.c

---

Diff:  https://github.com/kamailio/kamailio/commit/37e59b5d1d3d12a2358d24fc5e37f2f55ee2e41a.diff
Patch: https://github.com/kamailio/kamailio/commit/37e59b5d1d3d12a2358d24fc5e37f2f55ee2e41a.patch

---

diff --git a/modules/http_client/functions.c b/modules/http_client/functions.c
index 7bd1564..546ffc4 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);
@@ -381,7 +384,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);
 
@@ -423,6 +431,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);
 




More information about the sr-dev mailing list