[sr-dev] git:master:ee14cf1e: httpapitest Small cosmetic fixes

Olle E. Johansson oej at edvina.net
Tue Jun 7 08:37:54 CEST 2016


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

Author: Olle E. Johansson <oej at edvina.net>
Committer: Olle E. Johansson <oej at edvina.net>
Date: 2016-06-07T08:37:50+02:00

httpapitest Small cosmetic fixes

---

Modified: test/mod_httpapitest/httpapitest.c
Modified: test/mod_httpapitest/test/curlapi.cfg

---

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

---

diff --git a/test/mod_httpapitest/httpapitest.c b/test/mod_httpapitest/httpapitest.c
index be50d51..921074d 100644
--- a/test/mod_httpapitest/httpapitest.c
+++ b/test/mod_httpapitest/httpapitest.c
@@ -56,6 +56,7 @@ static httpc_api_t httpapi;
 
 /* Exported functions */
 static cmd_export_t cmds[] = {
+	/* Test_http_connect(connection, <URL>, <result pvar>)  - HTTP GET */
 	{"test_http_connect", (cmd_function)w_testcurl_connect, 3, fixup_testcurl_connect,
 	 	fixup_free_testcurl_connect,
 		REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE},
@@ -123,20 +124,24 @@ static void destroy(void)
 
 
 /*
- * Fix curl_connect params: connection(string/pvar) url (string that may contain pvars) and
- * result (writable pvar).
+ * Fix test_curl_connect params: 
+ * 1. connection(string/pvar) 
+ * 2. url (string that may contain pvars) and
+ * 3. result (writable pvar).
  */
 static int fixup_testcurl_connect(void** param, int param_no)
 {
 
+	/* 1. Connection */
 	if (param_no == 1) {
 		/* We want char * strings */
 		return 0;
 	}
-	/* URL and data may contain pvar */
+	/* 2. URL and data may contain pvar */
 	if (param_no == 2) {
 		return fixup_spve_null(param, 1);
 	}
+	/* 3. PVAR for result */
 	if (param_no == 3) {
 		if (fixup_pvar_null(param, 1) != 0) {
 			LM_ERR("failed to fixup result pvar\n");
diff --git a/test/mod_httpapitest/test/curlapi.cfg b/test/mod_httpapitest/test/curlapi.cfg
index 4cd6ff0..a6d5a8a 100644
--- a/test/mod_httpapitest/test/curlapi.cfg
+++ b/test/mod_httpapitest/test/curlapi.cfg
@@ -5,7 +5,7 @@
 #
 #
 
-debug=3
+debug=2
 log_stderror=yes
 fork=no
 
@@ -55,12 +55,12 @@ onsend_route
 # This route is executed at Kamailio start
 event_route[htable:mod-init]
 {
-	xlog("L_ERR", "### Kamailio starting $timef(HH:mm) \n");
+	xlog("L_ERR", "### Kamailio starting $timef(%HH:%mm) \n");
 	$var(html) = "";
 
 	$var(res) = test_http_connect("lisa", "", "$avp(html)");
 
-	xlog("L_ERR", "-- Lisa http_client connection: $avp(gurka) Result $var(res)\n");
+	xlog("L_ERR", "-- Lisa http_client connection: Result $var(res) Response:\n--------\n$avp(html)\n------\n");
 
 
 }




More information about the sr-dev mailing list