提交 7ad93226 authored 作者: Michael Jerris's avatar Michael Jerris

fix for MDXMLINT-8

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5554 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4da5a5f6
...@@ -72,6 +72,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con ...@@ -72,6 +72,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
xml_binding_t *binding = (xml_binding_t *) user_data; xml_binding_t *binding = (xml_binding_t *) user_data;
char *file_url; char *file_url;
struct curl_slist *slist = NULL; struct curl_slist *slist = NULL;
long httpRes;
if (!binding) { if (!binding) {
return NULL; return NULL;
...@@ -126,6 +127,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con ...@@ -126,6 +127,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
} }
curl_easy_perform(curl_handle); curl_easy_perform(curl_handle);
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE,&httpRes);
curl_easy_cleanup(curl_handle); curl_easy_cleanup(curl_handle);
close(config_data.fd); close(config_data.fd);
} else { } else {
...@@ -134,8 +136,13 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con ...@@ -134,8 +136,13 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
switch_safe_free(data); switch_safe_free(data);
if (!(xml = switch_xml_parse_file(filename))) { if(httpRes==200) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result!\n"); if (!(xml = switch_xml_parse_file(filename))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result!\n");
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received HTTP error %ld trying to fetch %s\n",httpRes,key_value);
xml=NULL;
} }
unlink(filename); unlink(filename);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论