- improve libmagic support
[m6w6/ext-http] / http_request_pool_api.c
index 1775293452eddf63cd526c8d23d60d248677370c..282fda9ed2df25b2becac2c64ccd09e617642fb0 100644 (file)
 
 ZEND_EXTERN_MODULE_GLOBALS(http);
 
+#ifndef HAVE_CURL_MULTI_STRERROR
+#      define curl_multi_strerror(dummy) "unknown error"
+#endif
+
 static void http_request_pool_freebody(http_request_body **body);
 static int http_request_pool_compare_handles(void *h1, void *h2);
 
@@ -182,7 +186,11 @@ PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool TSRMLS_DC)
                fprintf(stderr, "> %d unfinished requests of pool %p remaining\n", pool->unfinished, pool);
 #endif
                if (SUCCESS != http_request_pool_select(pool)) {
-                       http_error(HE_WARNING, HTTP_E_SOCKET, "Socket error");
+#ifdef PHP_WIN32
+                       http_error(HE_WARNING, HTTP_E_SOCKET, WSAGetLastError());
+#else
+                       http_error(HE_WARNING, HTTP_E_SOCKET, strerror(errno));
+#endif
                        return FAILURE;
                }
        }