- reset request->_error
[m6w6/ext-http] / http_request_api.c
index 3fa73e217e6c6ebe9d651ab3ee3eded5981399a1..d07305e6930fb84e51fe953af5ca781f18534623 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';
 }
 /* }}} */
 
@@ -872,6 +873,7 @@ PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info)
        HTTP_CURL_INFO(CURLINFO_HTTPAUTH_AVAIL);
        HTTP_CURL_INFO(CURLINFO_PROXYAUTH_AVAIL);
        HTTP_CURL_INFO(CURLINFO_OS_ERRNO);
+       add_assoc_string(&array, "error", request->_error, 1);
        HTTP_CURL_INFO(CURLINFO_NUM_CONNECTS);
 #if LIBCURL_VERSION_NUM >= 0x070e01
        HTTP_CURL_INFO_EX(CURLINFO_COOKIELIST, "cookies");