]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Wrong week to quit sniffing glue
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 11 May 2012 18:34:42 +0000 (13:34 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 11 May 2012 18:34:42 +0000 (13:34 -0500)
src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c

index 722dd8c9a16bc152d0565334588930c43dabed88..97b6bdcf0a7927b325d54b0e0dfe5a5e181d503b 100644 (file)
@@ -140,6 +140,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
                        }
 
                        stream.write_function(&stream, "%s", buf);
+                       txt = (char *) stream.data;
                }
 
                scgi_disconnect(&handle);
@@ -154,17 +155,21 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
                goto end;
        }
 
+       
+
        if (GLOBAL_DEBUG) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s\nPOST_DATA:\n%s\n\nRESPONSE:-----\n%s\n-----\n", binding->url, data, txt);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s\nPOST_DATA:\n%s\n\nRESPONSE:\n-----\n%s\n-----\n", 
+                                                 binding->url, data, switch_str_nil(txt));
        }
 
-       if (bytes) {
-               if ((xml = switch_xml_parse_str_dynamic(txt, FALSE))) {
-                       txt = NULL;
-               } else {
+       
+
+       if (bytes && txt) {
+               if (!(xml = switch_xml_parse_str_dynamic(txt, FALSE))) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result! [%s]\ndata: [%s] RESPONSE[%s]\n", 
                                                          binding->url, data, switch_str_nil(txt));
                }
+               txt = NULL;
        } else {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received error trying to fetch %s\ndata: [%s] RESPONSE [%s]\n", 
                                                  binding->url, data, switch_str_nil(txt));