2
0
Эх сурвалжийг харах

http_client Rename "curlcon" => "httpcon"

Olle E. Johansson 9 жил өмнө
parent
commit
8c303bf1e9

+ 17 - 19
modules/http_client/README

@@ -41,7 +41,7 @@ Carsten Bock
               3.8. tlscipherlist (string)
               3.9. tlsverifypeer (int)
               3.10. tlsverifyhost (int)
-              3.11. curlcon (string)
+              3.11. httpcon (string)
 
         4. Functions
 
@@ -76,7 +76,7 @@ Carsten Bock
    1.8. Set tlscipherlist parameter
    1.9. Set tlsverifypeer parameter
    1.10. Set tlsverifyhost parameter
-   1.11. Set curlcon parameter
+   1.11. Set httpcon parameter
    1.12. http_connect() usage
    1.13. curl_http_query() usage
 
@@ -102,7 +102,7 @@ Chapter 1. Admin Guide
         3.8. tlscipherlist (string)
         3.9. tlsverifypeer (int)
         3.10. tlsverifyhost (int)
-        3.11. curlcon (string)
+        3.11. httpcon (string)
 
    4. Functions
 
@@ -173,7 +173,7 @@ Chapter 1. Admin Guide
    3.8. tlscipherlist (string)
    3.9. tlsverifypeer (int)
    3.10. tlsverifyhost (int)
-   3.11. curlcon (string)
+   3.11. httpcon (string)
 
 3.1. httpredirect (int)
 
@@ -318,7 +318,7 @@ modparam("http_client", "tlsverifypeer", 1)
 modparam("http_client", "tlsverifyhost", 2)
 ...
 
-3.11. curlcon (string)
+3.11. httpcon (string)
 
    Defines a connection and credentials for the connection for use in a
    connection-oriented function call in this module.
@@ -327,7 +327,7 @@ modparam("http_client", "tlsverifyhost", 2)
    <connection-name>=><schema>://[<username>:<password>@]<hostname/address
    >[;param=value]
 
-   The address in the URL is the base for the URL in the curlcon_query()
+   The address in the URL is the base for the URL in the http_connect()
    call. The address given in the function call will be appended to the
    base URL in the connection definition.
 
@@ -347,15 +347,14 @@ modparam("http_client", "tlsverifyhost", 2)
      * verifyhost Set to 2 to enable or 0 to disable server hostname
        verification. Overrides tlsverifyhost modparam.
 
-   Example 1.11. Set curlcon parameter
+   Example 1.11. Set httpcon parameter
 ...
-modparam("http_client", "http_client.on", "apione=>http://atlanta.example.com")
-modparam("http_client", "http_client.on", "apitwo=>http://atlanta.example.com/ap
-i/12")
-modparam("http_client", "http_client.on", "apithree=>http://annabella:mysecret@a
-tlanta.example.com/api/12")
-modparam("http_client", "http_client.on", "apifour=>http://stockholm.example.com
-/api/getstuff;timeout=12")
+modparam("http_client", "httpcon", "apione=>http://atlanta.example.com")
+modparam("http_client", "httpcon", "apitwo=>http://atlanta.example.com/api/12")
+modparam("http_client", "httpcon", "apithree=>http://annabella:mysecret@atlanta.
+example.com/api/12")
+modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/ge
+tstuff;timeout=12")
 ...
 
 4. Functions
@@ -367,8 +366,8 @@ modparam("http_client", "http_client.on", "apifour=>http://stockholm.example.com
 
    Sends HTTP GET or POST request to a given connection. For a POST
    request, content-type can be specified.
-     * connection - the name of an existing curl connection, definied by a
-       modparam.
+     * connection - the name of an existing HTTP connection, definied by a
+       httpcon modparam.
        url - the part of the URL to add to the predefined URL in the
        connection definition.
        content_type - Used only when posting data with HTTP POST. An
@@ -387,8 +386,7 @@ modparam("http_client", "http_client.on", "apifour=>http://stockholm.example.com
 
    Example 1.12. http_connect() usage
 ...
-modparam("http_client", "http_client.on", "apiserver=>http://kamailio.org/api/")
-;
+modparam("http_client", "httpcon", "apiserver=>http://kamailio.org/api/");
 ...
 # POST Request
 $var(res) = http_connect("apiserver", "/mailbox", "application/json", "{ ok, {20
@@ -462,7 +460,7 @@ switch ($retcode) {
 
 6.1. httpclient.listcon
 
-   Lists all defined connections
+   Lists all defined httpcon connections
 
    Parameters:
      * No parameters

+ 7 - 7
modules/http_client/curlcon.c

@@ -22,7 +22,7 @@
  */
 
 /*! \file
- * \brief  Kamailio http_client :: Connectoin handling
+ * \brief  Kamailio http_client :: Connection handling
  * \ingroup http_client
  */
 
@@ -68,7 +68,7 @@ curl_con_t* curl_get_connection(str *name)
 	unsigned int conid;
 
 	conid = core_case_hash(name, 0, 0);
-	LM_DBG("curl_get_connection looking for curlcon: [%.*s] ID %u\n", name->len, name->s, conid);
+	LM_DBG("curl_get_connection looking for httpcon: [%.*s] ID %u\n", name->len, name->s, conid);
 
 	cc = _curl_con_root;
 	while(cc)
@@ -78,12 +78,12 @@ curl_con_t* curl_get_connection(str *name)
 		}
 		cc = cc->next;
 	}
-	LM_DBG("curl_get_connection no success in looking for curlcon: [%.*s]\n", name->len, name->s);
+	LM_DBG("curl_get_connection no success in looking for httpcon: [%.*s]\n", name->len, name->s);
 	return NULL;
 }
 
 
-/*! Parse the curlcon module parameter
+/*! Parse the httpcon module parameter
  *
  *	Syntax:
  *		name => proto://user:password@server/url/url
@@ -131,7 +131,7 @@ int curl_parse_param(char *val)
 	curl_con_t *cc;
 
 	LM_INFO("curl modparam parsing starting\n");
-	LM_DBG("modparam curlcon: %s\n", val);
+	LM_DBG("modparam httpcon: %s\n", val);
 
 	/* parse: name=>http_url*/
 	in.s = val;
@@ -268,7 +268,7 @@ int curl_parse_param(char *val)
 
 		if (parse_params(&params, CLASS_ANY, &phooks, &conparams) < 0)
                 {
-                        LM_ERR("CURL failed parsing curlcon parameters value\n");
+                        LM_ERR("CURL failed parsing httpcon parameters value\n");
                         goto error;
                 }
 
@@ -408,7 +408,7 @@ curl_con_t *curl_init_con(str *name)
 	unsigned int conid;
 
 	conid = core_case_hash(name, 0, 0);
-	LM_DBG("curl_init_con curlcon: [%.*s] ID %u\n", name->len, name->s, conid);
+	LM_DBG("curl_init_con httpcon: [%.*s] ID %u\n", name->len, name->s, conid);
 
 	cc = _curl_con_root;
 	while(cc)

+ 11 - 11
modules/http_client/doc/http_client_admin.xml

@@ -295,8 +295,8 @@ modparam("http_client", "tlsverifyhost", 2)
 				</programlisting>
 			</example>
 		</section>
-		<section id="http_client.p.curlcon">
-			<title><varname>curlcon</varname> (string)</title>
+		<section id="http_client.p.httpcon">
+			<title><varname>httpcon</varname> (string)</title>
 			<para>
 			Defines a connection and credentials for the connection for use
 			in a connection-oriented function call in this module.
@@ -306,7 +306,7 @@ modparam("http_client", "tlsverifyhost", 2)
 			&lt;connection-name&gt;=&gt;&lt;schema&gt;://[&lt;username&gt;:&lt;password&gt;@]&lt;hostname/address&gt;[;param=value]
 			</para>
 			<para>
-			The address in the URL is the base for the URL in the <function>curlcon_query()</function> call. The
+			The address in the URL is the base for the URL in the <function>http_connect()</function> call. The
 			address given in the function call will be appended to the base URL in the connection definition.
 			</para>
 			<para>
@@ -346,13 +346,13 @@ modparam("http_client", "tlsverifyhost", 2)
 			</itemizedlist>
 			</para>
 			<example>
-			<title>Set <varname>curlcon</varname> parameter</title>
+			<title>Set <varname>httpcon</varname> parameter</title>
 				<programlisting format="linespecific">
 ...
-modparam("http_client", "http_client.on", "apione=>http://atlanta.example.com")
-modparam("http_client", "http_client.on", "apitwo=>http://atlanta.example.com/api/12")
-modparam("http_client", "http_client.on", "apithree=>http://annabella:[email protected]/api/12")
-modparam("http_client", "http_client.on", "apifour=>http://stockholm.example.com/api/getstuff;timeout=12")
+modparam("http_client", "httpcon", "apione=>http://atlanta.example.com")
+modparam("http_client", "httpcon", "apitwo=>http://atlanta.example.com/api/12")
+modparam("http_client", "httpcon", "apithree=>http://annabella:[email protected]/api/12")
+modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/getstuff;timeout=12")
 ...
 				</programlisting>
 			</example>
@@ -373,7 +373,7 @@ modparam("http_client", "http_client.on", "apifour=>http://stockholm.example.com
                 		<listitem>
                         		<para>
                                 		<emphasis>connection</emphasis> - the name of an existing
-						curl connection, definied by a modparam.
+						HTTP connection, definied by a httpcon modparam.
 					</para>
                         		<para>
                                 		<emphasis>url</emphasis> - the part of the URL to add to the
@@ -408,7 +408,7 @@ modparam("http_client", "http_client.on", "apifour=>http://stockholm.example.com
 				<title><function>http_connect()</function> usage</title>
 				<programlisting format="linespecific">
 ...
-modparam("http_client", "http_client.on", "apiserver=>http://kamailio.org/api/");
+modparam("http_client", "httpcon", "apiserver=>http://kamailio.org/api/");
 ...
 # POST Request
 $var(res) = http_connect("apiserver", "/mailbox", "application/json", "{ ok, {200, ok}}", "$avp(gurka)");
@@ -497,7 +497,7 @@ switch ($retcode) {
 		<section>
 			<title><function moreinfo="none">httpclient.listcon</function></title>
 			<para>
-				Lists all defined connections
+				Lists all defined httpcon connections
 			</para>
 		<para>Parameters:</para>
 		<itemizedlist>

+ 6 - 6
modules/http_client/http_client.c

@@ -138,7 +138,7 @@ static cmd_export_t cmds[] = {
 /* Exported parameters */
 static param_export_t params[] = {
     	{"connection_timeout", PARAM_INT, &default_connection_timeout},
-	{"curlcon",  PARAM_STRING|USE_FUNC_PARAM, (void*)curl_con_param},
+	{"httpcon",  PARAM_STRING|USE_FUNC_PARAM, (void*)curl_con_param},
 	{"tlscacert", PARAM_STRING,  &default_tls_cacert },
 	{"tlsclientcert", PARAM_STR, &default_tls_clientcert },
 	{"tlsclientkey", PARAM_STR, &default_tls_clientkey },
@@ -204,7 +204,7 @@ static void destroy_shmlock(void)
 /* Init counters */
 static void curl_counter_init()
 {
-        counter_register(&connections, "httpclient", "connections", 0, 0, 0, "Counter of connection definitions (curlcon)", 0);
+        counter_register(&connections, "httpclient", "connections", 0, 0, 0, "Counter of connection definitions (httpcon)", 0);
         counter_register(&connok, "httpclient", "connok", 0, 0, 0, "Counter of successful connections (200 OK)", 0);
         counter_register(&connfail, "httpclient", "connfail", 0, 0, 0, "Counter of failed connections (not 200 OK)", 0);
 }
@@ -299,7 +299,7 @@ static void destroy(void)
 
 
 /**
- * parse curlcon module parameter
+ * parse httpcon module parameter
  */
 int curl_con_param(modparam_t type, void *val)
 {
@@ -307,7 +307,7 @@ int curl_con_param(modparam_t type, void *val)
 		goto error;
 	}
 
-	LM_DBG("**** CURL got modparam curlcon \n");
+	LM_DBG("**** HTTP_CLIENT got modparam httpcon \n");
 	return curl_parse_param((char*)val);
 error:
 	return -1;
@@ -712,8 +712,8 @@ static int pv_parse_curlredirect(pv_spec_p sp, str *in)
 }
 
 /*
- * PV - return curl redirect URL for curlcon
- *	$curlredirect("curlcon");
+ * PV - return curl redirect URL for httpcon
+ *	$curlredirect("httpcon");
  */
 static int pv_get_curlredirect(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 {