- reverse request history
[m6w6/ext-http] / http_request_api.c
index 3fa73e217e6c6ebe9d651ab3ee3eded5981399a1..613c32a8820ee2f82780e378aef80ec1a4f9878c 100644 (file)
@@ -412,6 +412,7 @@ PHP_HTTP_API void _http_request_reset(http_request *request)
        if (request->ch) {
                http_request_defaults(request);
        }
+       request->_error[0] = '\0';
 }
 /* }}} */
 
@@ -871,11 +872,12 @@ PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info)
        HTTP_CURL_INFO(CURLINFO_CONTENT_TYPE);
        HTTP_CURL_INFO(CURLINFO_HTTPAUTH_AVAIL);
        HTTP_CURL_INFO(CURLINFO_PROXYAUTH_AVAIL);
-       HTTP_CURL_INFO(CURLINFO_OS_ERRNO);
        HTTP_CURL_INFO(CURLINFO_NUM_CONNECTS);
 #if LIBCURL_VERSION_NUM >= 0x070e01
        HTTP_CURL_INFO_EX(CURLINFO_COOKIELIST, "cookies");
 #endif
+       HTTP_CURL_INFO(CURLINFO_OS_ERRNO);
+       add_assoc_string(&array, "error", request->_error, 1);
 }
 /* }}} */