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:
Michael Jerris 2007-08-03 04:21:29 +00:00
parent 4da5a5f601
commit 7ad9322686
1 changed files with 9 additions and 2 deletions

View File

@ -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
} }
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
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);