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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2021-08-24T09:36:06+02:00

ruxc: groupped setting request params in a function

---

Modified: src/modules/ruxc/ruxc_mod.c

---

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

---

diff --git a/src/modules/ruxc/ruxc_mod.c b/src/modules/ruxc/ruxc_mod.c
index a31f650873..427c8e2091 100644
--- a/src/modules/ruxc/ruxc_mod.c
+++ b/src/modules/ruxc/ruxc_mod.c
@@ -131,6 +131,22 @@ static void mod_destroy(void)
        return;
 }
 
+/**
+ *
+ */
+static void ruxc_request_params_init(RuxcHTTPRequest *v_http_request)
+{
+    v_http_request->timeout = _ruxc_http_timeout;
+    v_http_request->timeout_connect = _ruxc_http_timeout;
+    v_http_request->timeout_read = _ruxc_http_timeout;
+    v_http_request->timeout_write = _ruxc_http_timeout;
+       v_http_request->tlsmode = _ruxc_http_tlsmode;
+       v_http_request->reuse = _ruxc_http_reuse;
+       v_http_request->retry = _ruxc_http_retry;
+       v_http_request->logtype = _ruxc_http_logtype;
+       v_http_request->debug = _ruxc_http_debug;
+}
+
 /**
  *
  */
@@ -142,15 +158,7 @@ static int ki_ruxc_http_get_helper(sip_msg_t *_msg, str 
*url, str *hdrs,
        pv_value_t val = {0};
        int ret;
 
-    v_http_request.timeout = _ruxc_http_timeout;
-    v_http_request.timeout_connect = _ruxc_http_timeout;
-    v_http_request.timeout_read = _ruxc_http_timeout;
-    v_http_request.timeout_write = _ruxc_http_timeout;
-       v_http_request.tlsmode = _ruxc_http_tlsmode;
-       v_http_request.reuse = _ruxc_http_reuse;
-       v_http_request.retry = _ruxc_http_retry;
-       v_http_request.logtype = _ruxc_http_logtype;
-       v_http_request.debug = _ruxc_http_debug;
+       ruxc_request_params_init(&v_http_request);
 
        v_http_request.url = url->s;
        v_http_request.url_len = url->len;
@@ -243,15 +251,7 @@ static int ki_ruxc_http_post_helper(sip_msg_t *_msg, str 
*url, str *body, str *h
        pv_value_t val = {0};
        int ret;
 
-    v_http_request.timeout = _ruxc_http_timeout;
-    v_http_request.timeout_connect = _ruxc_http_timeout;
-    v_http_request.timeout_read = _ruxc_http_timeout;
-    v_http_request.timeout_write = _ruxc_http_timeout;
-       v_http_request.tlsmode = _ruxc_http_tlsmode;
-       v_http_request.reuse = _ruxc_http_reuse;
-       v_http_request.retry = _ruxc_http_retry;
-       v_http_request.logtype = _ruxc_http_logtype;
-       v_http_request.debug = _ruxc_http_debug;
+       ruxc_request_params_init(&v_http_request);
 
        v_http_request.url = url->s;
        v_http_request.url_len = url->len;


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to