mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-10 19:52:41 +00:00
fix for MDXMLINT-8
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5554 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
4da5a5f601
commit
7ad9322686
1 file changed
+9
-2
@@ -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;
|
||||
char *file_url;
|
||||
struct curl_slist *slist = NULL;
|
||||
long httpRes;
|
||||
|
||||
if (!binding) {
|
||||
return NULL;
|
||||
@@ -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_getinfo(curl_handle, CURLINFO_RESPONSE_CODE,&httpRes);
|
||||
curl_easy_cleanup(curl_handle);
|
||||
close(config_data.fd);
|
||||
} else {
|
||||
@@ -134,8 +136,13 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
||||
|
||||
switch_safe_free(data);
|
||||
|
||||
if (!(xml = switch_xml_parse_file(filename))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing Result!\n");
|
||||
if(httpRes==200) {
|
||||
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);
|
||||
|
||||
Reference in new issue
Block a user