Improve error handling in MSExchangeFreeBusy class

pull/232/head
Francis Lachapelle 2017-01-19 10:17:17 -05:00
parent 41dbb88b64
commit fcb79dc14b
1 changed files with 5 additions and 2 deletions

View File

@ -133,16 +133,19 @@ size_t curl_body_function_freebusy(void *ptr, size_t size, size_t nmemb, void *i
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, [rawRequest UTF8String]);
//curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curlHeaderFunction);
//curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_body_function_freebusy);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, self);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error);
error[0] = 0;
// Perform SOAP request
rc = curl_easy_perform(curl);
if (rc != 0)
[self errorWithFormat: @"CURL error while accessing %@ (%d): ", url, rc, [NSString stringWithCString: error]];
if (rc != CURLE_OK)
[self errorWithFormat: @"CURL error while accessing %@ (%d): %@", url, rc,
[NSString stringWithCString: strlen(error) ? error : curl_easy_strerror(rc)]];
curl_easy_cleanup(curl);
curl_slist_free_all(headerlist);