Fri Apr 16 08:47:39 EST 2010  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
  * Fix hscurl.c when URL is downloaded during the first call to curl_multi_perform.
  Turns out that the first call to curl_multi_perform() can fetch the URL or
  result in error. I can easily reproduce this using HTTP server on localhost.
  This means that situation when running_handles is zero is valid, so remove the
  error and handle it correctly.
Index: darcs/src/hscurl.c
===================================================================
--- darcs.orig/src/hscurl.c	2010-05-23 18:58:07.000000000 +1000
+++ darcs/src/hscurl.c	2010-11-09 20:00:47.012893809 +1100
@@ -16,7 +16,6 @@
     RESULT_MULTI_INIT_FAIL,
     RESULT_EASY_INIT_FAIL,
     RESULT_SLIST_APPEND_FAIL,
-    RESULT_NO_RUNNING_HANDLES,
     RESULT_MULTI_INFO_READ_FAIL,
     RESULT_UNKNOWN_MESSAGE,
     RESULT_FILE_OPEN_FAIL
@@ -30,7 +29,6 @@
     "curl_multi_init() failed",
     "curl_easy_init() failed",
     "curl_slist_append() failed",
-    "curl_multi_perform() - no running handles",
     "curl_multi_info_read() failed",
     "curl_multi_info_read() returned unknown message",
     "fopen() failed"
@@ -64,11 +62,9 @@
   error = curl_multi_perform(multi, &running_handles);
   if (error != CURLM_OK && error != CURLM_CALL_MULTI_PERFORM)
     return curl_multi_strerror(error);
-  if (running_handles == 0)
-    return error_strings[RESULT_NO_RUNNING_HANDLES];
 
   running_handles_last = running_handles;
-  while (1)
+  while (running_handles_last > 0)
     {
       while (error == CURLM_CALL_MULTI_PERFORM)
         error = curl_multi_perform(multi, &running_handles);
