]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
option to disable 100 continue (MDXMLINT-24), Thanks Shannon.
authorMichael Jerris <mike@jerris.com>
Fri, 1 Feb 2008 21:14:53 +0000 (21:14 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 1 Feb 2008 21:14:53 +0000 (21:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7473 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/autoload_configs/xml_cdr.conf.xml
src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c

index 70145b501fef00ff079d6a8619ebdf302c28efa9..1561ddd5efe65d3969fa5de07df283bcbffb9925 100644 (file)
@@ -23,6 +23,9 @@
 \r
     <!-- encode the post data may be 'true' for url encoding, 'false' for no encoding or 'base64' for base64 encoding -->\r
     <param name="encode" value="true"/>\r
+\r
+    <!-- optional: set to true to disable Expect: 100-continue lighttpd requires this setting --> \r
+    <!--<param name="disable-100-continue" value="true"/>--> \r
     \r
     <!-- optional: full path to the error log dir for failed web posts if not specified its the same as log-dir -->\r
     <!-- either an absolute path, a relative path assuming ${prefix}/logs or a blank or omitted value will default to ${prefix}/logs/xml_cdr -->\r
index f282a734ebca9013470120c72c5e067703c8beb6..1701072b2afbdbdf0b87e81315bb75f9faaaa61f 100644 (file)
@@ -45,6 +45,7 @@ static struct {
        uint32_t ignore_cacert_check;
        int encode;
        int log_b;
+       int disable100continue;
 } globals;
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load);
@@ -121,6 +122,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
        /* try to post it to the web server */
        if (!switch_strlen_zero(globals.url)) {
                struct curl_slist *headers = NULL;
+               struct curl_slist *slist = NULL;
                curl_handle = curl_easy_init();
                
                if (globals.encode) {
@@ -158,6 +160,11 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
                curl_easy_setopt(curl_handle, CURLOPT_URL, globals.url);
                curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-xml/1.0");
                curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, httpCallBack);
+
+               if (globals.disable100continue) {
+                       slist = curl_slist_append(slist, "Expect:");
+                       curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, slist);
+               }
                
                if (globals.ignore_cacert_check) {
                        curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE);
@@ -245,6 +252,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)
 
        memset(&globals,0,sizeof(globals));
        globals.log_b = 1;
+       globals.disable100continue = 0;
 
        /* parse the config */
        if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
@@ -265,6 +273,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)
                                globals.delay = (uint32_t) atoi(val);
                        } else if (!strcasecmp(var, "log-b-leg")) {
                                globals.log_b = switch_true(val);
+                       } else if (!strcasecmp(var, "disable-100-continue") && switch_true(val)) {
+                               globals.disable100continue = 1;
                        } else if (!strcasecmp(var, "encode")) {
                                if (!strcasecmp(val, "base64")) {
                                        globals.encode = 2;