浏览代码

curl Add documentation for new parameter "maxdatasize"

Olle E. Johansson 10 年之前
父节点
当前提交
c100654e5c
共有 2 个文件被更改,包括 77 次插入40 次删除
  1. 56 40
      modules/curl/README
  2. 21 0
      modules/curl/doc/curl_admin.xml

+ 56 - 40
modules/curl/README

@@ -33,12 +33,13 @@ Carsten Bock
 
               3.1. httpredirect (int)
               3.2. useragent (string)
-              3.3. connection_timeout (int)
-              3.4. tlsclientcert (string)
-              3.5. tlsclientkey (string)
-              3.6. tlscacert (string)
-              3.7. tlsverifyserver (int)
-              3.8. curlcon (string)
+              3.3. maxdatasize (int)
+              3.4. connection_timeout (int)
+              3.5. tlsclientcert (string)
+              3.6. tlsclientkey (string)
+              3.7. tlscacert (string)
+              3.8. tlsverifyserver (int)
+              3.9. curlcon (string)
 
         4. Functions
 
@@ -65,14 +66,15 @@ Carsten Bock
 
    1.1. Set httpredirect parameter
    1.2. Set useragent parameter
-   1.3. Set connection_timeout parameter
-   1.4. Set tlsclientcert parameter
-   1.5. Set tlsclientkey parameter
-   1.6. Set tlscacert parameter
-   1.7. Set tlsverifyserver parameter
-   1.8. Set curlcon parameter
-   1.9. curl_connect() usage
-   1.10. curl_http_query() usage
+   1.3. Set maxdatasize parameter
+   1.4. Set connection_timeout parameter
+   1.5. Set tlsclientcert parameter
+   1.6. Set tlsclientkey parameter
+   1.7. Set tlscacert parameter
+   1.8. Set tlsverifyserver parameter
+   1.9. Set curlcon parameter
+   1.10. curl_connect() usage
+   1.11. curl_http_query() usage
 
 Chapter 1. Admin Guide
 
@@ -88,12 +90,13 @@ Chapter 1. Admin Guide
 
         3.1. httpredirect (int)
         3.2. useragent (string)
-        3.3. connection_timeout (int)
-        3.4. tlsclientcert (string)
-        3.5. tlsclientkey (string)
-        3.6. tlscacert (string)
-        3.7. tlsverifyserver (int)
-        3.8. curlcon (string)
+        3.3. maxdatasize (int)
+        3.4. connection_timeout (int)
+        3.5. tlsclientcert (string)
+        3.6. tlsclientkey (string)
+        3.7. tlscacert (string)
+        3.8. tlsverifyserver (int)
+        3.9. curlcon (string)
 
    4. Functions
 
@@ -148,12 +151,13 @@ Chapter 1. Admin Guide
 
    3.1. httpredirect (int)
    3.2. useragent (string)
-   3.3. connection_timeout (int)
-   3.4. tlsclientcert (string)
-   3.5. tlsclientkey (string)
-   3.6. tlscacert (string)
-   3.7. tlsverifyserver (int)
-   3.8. curlcon (string)
+   3.3. maxdatasize (int)
+   3.4. connection_timeout (int)
+   3.5. tlsclientcert (string)
+   3.6. tlsclientkey (string)
+   3.7. tlscacert (string)
+   3.8. tlsverifyserver (int)
+   3.9. curlcon (string)
 
 3.1. httpredirect (int)
 
@@ -179,18 +183,30 @@ modparam("curl", "httpredirect", 0)
 modparam("curl", "useragent", "Secret HTTP REST grabber 0.42")
 ...
 
-3.3. connection_timeout (int)
+3.3. maxdatasize (int)
+
+   Defines the maximum size in bytes for a response. Note that this is
+   allocated from pkg memory (process memory) dynamically.
+
+   Default value is zero, i.e., the limit on the datasize is disabled.
+
+   Example 1.3. Set maxdatasize parameter
+...
+modparam("curl", "maxdatasize", 2000)
+...
+
+3.4. connection_timeout (int)
 
    Defines in seconds how long Kamailio waits for response from servers.
 
    Default value is zero, i.e., the timeout function is disabled.
 
-   Example 1.3. Set connection_timeout parameter
+   Example 1.4. Set connection_timeout parameter
 ...
 modparam("curl", "connection_timeout", 2)
 ...
 
-3.4. tlsclientcert (string)
+3.5. tlsclientcert (string)
 
    File name for a TLS client certificate. The certificate needs to be
    encoded in PEM format.
@@ -199,12 +215,12 @@ modparam("curl", "connection_timeout", 2)
    that if you specify a client cert, you also need to specify the
    tlsclientkey.
 
-   Example 1.4. Set tlsclientcert parameter
+   Example 1.5. Set tlsclientcert parameter
 ...
 modparam("curl", "tlsclientcert", "/var/certs/sollentuna.example.com.cert")
 ...
 
-3.5. tlsclientkey (string)
+3.6. tlsclientkey (string)
 
    File name for a TLS client key. The key needs to be encoded in PEM
    format.
@@ -213,12 +229,12 @@ modparam("curl", "tlsclientcert", "/var/certs/sollentuna.example.com.cert")
    used. Note that if you specify a client key, you also need to specify
    the tlsclientcert.
 
-   Example 1.5. Set tlsclientkey parameter
+   Example 1.6. Set tlsclientkey parameter
 ...
 modparam("curl", "tlsclientkey", "/var/certs/sollentuna.example.com.key")
 ...
 
-3.6. tlscacert (string)
+3.7. tlscacert (string)
 
    File name for the trusted TLS CA cert used to verify servers. The
    certificates need to be encoded in PEM format.
@@ -227,12 +243,12 @@ modparam("curl", "tlsclientkey", "/var/certs/sollentuna.example.com.key")
    the host. If tlsverifyhost is on, all TLS connections will fail without
    any CA certificate to validate with.
 
-   Example 1.6. Set tlscacert parameter
+   Example 1.7. Set tlscacert parameter
 ...
 modparam("curl", "tlscacert", "/var/certs/ca/edvina-sip-ca.pem")
 ...
 
-3.7. tlsverifyserver (int)
+3.8. tlsverifyserver (int)
 
    If set to 0, TLS verification of the server certificate is disabled.
    This means that the connection will get encrypted, but there's no
@@ -243,12 +259,12 @@ modparam("curl", "tlscacert", "/var/certs/ca/edvina-sip-ca.pem")
    configured, the server TLS certificate will be validated. If validation
    fails, the connection fails.
 
-   Example 1.7. Set tlsverifyserver parameter
+   Example 1.8. Set tlsverifyserver parameter
 ...
 modparam("curl", "tlsverifyserver", 1)
 ...
 
-3.8. curlcon (string)
+3.9. curlcon (string)
 
    Defines a connection and credentials for the connection for use in a
    connection-oriented function call in this module.
@@ -271,7 +287,7 @@ modparam("curl", "tlsverifyserver", 1)
      * useragent Useragent used for HTTP requests. Overrides useragent
        modparam.
 
-   Example 1.8. Set curlcon parameter
+   Example 1.9. Set curlcon parameter
 ...
 modparam("curl", "curlcon", "apione=>http://atlanta.example.com")
 modparam("curl", "curlcon", "apitwo=>http://atlanta.example.com/api/12")
@@ -308,7 +324,7 @@ timeout=12")
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
    FAILURE_ROUTE, and BRANCH_ROUTE.
 
-   Example 1.9. curl_connect() usage
+   Example 1.10. curl_connect() usage
 ...
 modparam("curl", "curlcon", "apiserver=>http://kamailio.org/api/");
 ...
@@ -346,7 +362,7 @@ xlog("L_INFO", "API-server Curl connection: $avp(route) Result code $var(res)\n"
    utils module. It is changed to use the same base library and settings
    as the rest of the functions in this module.
 
-   Example 1.10. curl_http_query() usage
+   Example 1.11. curl_http_query() usage
 ...
 # GET-Request
 curl_http_query("http://tutpro.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$

+ 21 - 0
modules/curl/doc/curl_admin.xml

@@ -96,6 +96,27 @@ modparam("curl", "httpredirect", 0)
 				<programlisting format="linespecific">
 ...
 modparam("curl", "useragent", "Secret HTTP REST grabber 0.42")
+...
+				</programlisting>
+			</example>
+		</section>
+		<section id="curl.p.maxdatasize">
+			<title><varname>maxdatasize</varname> (int)</title>
+			<para>
+			Defines the maximum size in bytes for a response. Note that this
+			is allocated from pkg memory (process memory) dynamically.
+			</para>
+			<para>
+			<emphasis>
+				Default value is zero, i.e.,
+				the limit on the datasize is disabled.
+			</emphasis>
+			</para>
+			<example>
+			<title>Set <varname>maxdatasize</varname> parameter</title>
+				<programlisting format="linespecific">
+...
+modparam("curl", "maxdatasize", 2000)
 ...
 				</programlisting>
 			</example>