- fix endless loop with bad input
[m6w6/ext-http] / http_request_api.c
index b92cbfe88b761d874cf3279979758c8f5ca98e5a..d94e558ec1593e04798869f82f22d3130d856fac 100644 (file)
@@ -722,15 +722,14 @@ PHP_HTTP_API STATUS _http_request_exec(CURL *ch, HashTable *info, phpstr *respon
 
        /* perform request */
        if (CURLE_OK != (result = curl_easy_perform(ch))) {
-               http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not perform request: %s", curl_easy_strerror(result));
-               return FAILURE;
-       } else {
-               /* get curl info */
-               if (info) {
-                       http_request_info(ch, info);
-               }
-               return SUCCESS;
+               http_error(HE_WARNING, HTTP_E_REQUEST, curl_easy_strerror(result));
+       }
+       /* get curl info */
+       if (info) {
+               http_request_info(ch, info);
        }
+       /* always succeeds */
+       return SUCCESS;
 }
 /* }}} */