[sr-dev] git:master:edf6fb9d: curl Removing some unused variables

Olle E. Johansson oej at edvina.net
Mon Nov 2 11:17:14 CET 2015


Module: kamailio
Branch: master
Commit: edf6fb9dc68acacf109bb421679289726dd8901d
URL: https://github.com/kamailio/kamailio/commit/edf6fb9dc68acacf109bb421679289726dd8901d

Author: Olle E. Johansson <oej at edvina.net>
Committer: Olle E. Johansson <oej at edvina.net>
Date: 2015-11-02T11:16:52+01:00

curl Removing some unused variables

---

Modified: modules/curl/curl.c
Modified: modules/curl/curlcon.c
Modified: modules/curl/curlrpc.c
Modified: modules/curl/functions.c

---

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

---

diff --git a/modules/curl/curl.c b/modules/curl/curl.c
index a485604..1e253a7 100644
--- a/modules/curl/curl.c
+++ b/modules/curl/curl.c
@@ -83,10 +83,6 @@ unsigned int	default_maxdatasize = 0;		/*!< Default download size. 0=disabled */
 
 static curl_version_info_data *curl_info;
 
-/* lock for configuration access */
-static gen_lock_t *conf_lock = NULL;
-
-
 /* Module management function prototypes */
 static int mod_init(void);
 static int child_init(int);
@@ -571,7 +567,6 @@ static int pv_get_curlerror(struct sip_msg *msg, pv_param_t *param, pv_value_t *
 {
 	str curlerr;
 	char *err = NULL;
-	CURLcode codeerr;
 
 	if(param==NULL) {
 		return -1;
@@ -598,7 +593,6 @@ static int pv_get_curlerror(struct sip_msg *msg, pv_param_t *param, pv_value_t *
  */
 static int pv_parse_curlredirect(pv_spec_p sp, str *in)
 {
-	int cerr  = 0;
 	if(sp==NULL || in==NULL || in->len<=0) {
 		return -1;
 	}
diff --git a/modules/curl/curlcon.c b/modules/curl/curlcon.c
index 3d3de99..c573cab 100644
--- a/modules/curl/curlcon.c
+++ b/modules/curl/curlcon.c
@@ -239,8 +239,6 @@ int curl_parse_param(char *val)
 	if (*p == ';') {
 		/* We have parameters */
 		str tok;
-		int_str ival;
-		int itype;
 		param_t *pit = NULL;
 
 		/* Adjust the URL length */
diff --git a/modules/curl/curlrpc.c b/modules/curl/curlrpc.c
index 551c9b3..a5b31b5 100644
--- a/modules/curl/curlrpc.c
+++ b/modules/curl/curlrpc.c
@@ -44,12 +44,7 @@ static const char* curl_rpc_listcon_doc[2] = {
 static void curl_rpc_listcon(rpc_t* rpc, void* ctx)
 {
 	void* th;
-	void* ih;
 	void* rh;
-	void* sh;
-	int j;
-	char c[3];
-	str data = {"", 0};
 	curl_con_t *cc;
 
 	cc = _curl_con_root;
diff --git a/modules/curl/functions.c b/modules/curl/functions.c
index 214eb32..19908c6 100644
--- a/modules/curl/functions.c
+++ b/modules/curl/functions.c
@@ -92,7 +92,7 @@ static int curL_query_url(struct sip_msg* _m, char* _url, char* _dst, const char
     CURL *curl;
     CURLcode res;  
     str value;
-    char *url, *at = NULL, *post;
+    char *url, *at = NULL;
     http_res_stream_t stream;
     long stat;
     pv_spec_t *dst;
@@ -172,6 +172,9 @@ static int curL_query_url(struct sip_msg* _m, char* _url, char* _dst, const char
    	res = curl_easy_perform(curl);  
     }
     pkg_free(url);
+    if (headerlist) {
+    	curl_slist_free_all(headerlist);
+    }
 
     if (res != CURLE_OK) {
 	/* http://curl.haxx.se/libcurl/c/libcurl-errors.html */
@@ -183,7 +186,6 @@ static int curL_query_url(struct sip_msg* _m, char* _url, char* _dst, const char
 		LM_ERR("failed to perform curl (%d)\n", res);
 	}
 
-	curl_slist_free_all(headerlist);
 	curl_easy_cleanup(curl);
 	if(stream.buf) {
 		pkg_free(stream.buf);
@@ -246,9 +248,6 @@ static int curL_query_url(struct sip_msg* _m, char* _url, char* _dst, const char
     }
 	
     /* CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ... ); */
-    if (headerlist) {
-    	curl_slist_free_all(headerlist);
-    }
     curl_easy_cleanup(curl);
     pkg_free(stream.buf);
     return stat;
@@ -267,7 +266,6 @@ int curl_con_query_url(struct sip_msg* _m, char *connection, char* _url, char* _
 	str urlbuf2;
 	char *urlbuf3 = NULL;
 
-	unsigned int len = 0;
 	str postdatabuf;
 	char *postdata = NULL;
 	unsigned int maxdatasize = default_maxdatasize;




More information about the sr-dev mailing list