提交 bbd9aa23 authored 作者: Anthony Minessale's avatar Anthony Minessale

another tweak

上级 afdfb9a6
...@@ -143,29 +143,38 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con ...@@ -143,29 +143,38 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
} }
scgi_disconnect(&handle); scgi_disconnect(&handle);
if (len < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s Connection Read Failed: [%s]\n", binding->url, handle.err);
goto end;
}
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s Connection Failed: [%s]\n", binding->url, handle.err); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DEBUG:\nURL: %s Connection Failed: [%s]\n", binding->url, handle.err);
switch_safe_free(data); goto end;
switch_safe_free(stream.data);
return NULL;
} }
if (GLOBAL_DEBUG) { 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%s\n-----\n", binding->url, data, txt);
} }
if (!len) { if (bytes) {
if (!(xml = switch_xml_parse_str(txt, strlen(txt)))) { if ((xml = switch_xml_parse_str(txt, strlen(txt)))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result! [%s]\ndata: [%s]\n", binding->url, data); txt = NULL;
} else {
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));
} }
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received error trying to fetch %s\ndata: [%s]\n", binding->url, data); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received error trying to fetch %s\ndata: [%s] RESPONSE [%s]\n",
switch_safe_free(stream.data); binding->url, data, switch_str_nil(txt));
xml = NULL;
} }
switch_safe_free(data);
end:
switch_safe_free(data);
switch_safe_free(txt);
return xml; return xml;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论