Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (15336 => 15337)
--- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c 2009-11-03 23:21:02 UTC (rev 15336)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c 2009-11-03 23:41:27 UTC (rev 15337)
@@ -56,6 +56,7 @@
switch_hash_t *vars_map;
int use_dynamic_url;
int auth_scheme;
+ int timeout;
};
static int keep_files_around = 0;
@@ -234,6 +235,10 @@
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &config_data);
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-xml/1.0");
+ if (binding->timeout) {
+ curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, binding->timeout);
+ }
+
if (binding->disable100continue) {
slist = curl_slist_append(slist, "Expect:");
curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, slist);
@@ -344,7 +349,7 @@
char *bind_mask = NULL;
char *method = NULL;
int disable100continue = 0;
- int use_dynamic_url = 0;
+ int use_dynamic_url = 0, timeout = 0;
uint32_t enable_cacert_check = 0;
char *ssl_cert_file = NULL;
char *ssl_key_file = NULL;
@@ -390,6 +395,8 @@
disable100continue = 1;
} else if (!strcasecmp(var, "method")) {
method = val;
+ } else if (!strcasecmp(var, "timeout")) {
+ timeout = timeout;
} else if (!strcasecmp(var, "enable-cacert-check") && switch_true(val)) {
enable_cacert_check = 1;
} else if (!strcasecmp(var, "ssl-cert-path")) {
@@ -440,7 +447,7 @@
memset(binding, 0, sizeof(*binding));
binding->auth_scheme = auth_scheme;
-
+ binding->timeout = timeout;
binding->url = strdup(url);
switch_assert(binding->url);