From cb089b3231482e96f7d473dc8b9984a040e6643a Mon Sep 17 00:00:00 2001 From: bzy-xyz Date: Fri, 19 Jan 2018 09:08:03 -0500 Subject: [PATCH] eve: address apparently spurious libcurl recv errors (#372) Some time after the last eve-related PR libcurl began returning `CURLE_RECV_ERROR` from `curl_easy_perform()`, even when the request returns good data that is otherwise usable. Now, if the `struct xmlData` has been populated by write_data, we use whatever came back (almost invariably a complete XML response). We don't depend on libcurl returning CURLE_OK. --- src/eve.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/eve.cc b/src/eve.cc index 2787aa57..df3b1ae7 100644 --- a/src/eve.cc +++ b/src/eve.cc @@ -186,7 +186,9 @@ static char *getXmlFromAPI(const char *apiKeyID, const char *apiVCode, const cha curl_easy_setopt(curl_handle, CURLOPT_URL, real_url.c_str()); - if ((rc = curl_easy_perform(curl_handle)) != CURLE_OK) { + rc = curl_easy_perform(curl_handle); + + if (chr.data == NULL) { return NULL; }