From d0dcc2cbec95f3bfae5da9ff07fc63833eb61342 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Mon, 22 May 2017 23:51:17 +0200 Subject: Fixed URL fetching bug on Win32 --- src/uscxml/util/URL.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/uscxml/util/URL.cpp b/src/uscxml/util/URL.cpp index ded4ae8..3fcb387 100644 --- a/src/uscxml/util/URL.cpp +++ b/src/uscxml/util/URL.cpp @@ -939,6 +939,9 @@ void URLFetcher::perform() { if (err != CURLM_OK) { LOGD(USCXML_WARN) << "curl_multi_timeout: " << curl_multi_strerror(err) << std::endl; } + // select on windows return -1, but this will make progress, see + // https://curl.haxx.se/mail/lib-2006-10/0100.html + while(CURLM_CALL_MULTI_PERFORM == curl_multi_perform(_multiHandle, &stillRunning)); } if(curlTimeOut >= 0) { @@ -964,6 +967,8 @@ void URLFetcher::perform() { switch(rc) { case -1: { /* select error */ +#if 0 + // this is not an actual error - there was just nothing to process #ifdef _WIN32 char *s = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, @@ -973,6 +978,7 @@ void URLFetcher::perform() { LOGD(USCXML_WARN) << "select: " << s << std::endl; LocalFree(s); #endif +#endif break; } case 0: /* timeout */ -- cgit v0.12