AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, "");
AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, "");
AC_DEFINE("HAVE_CURL_EASY_RESET", 1, "");
- AC_DEFINE("CURL_STATICLIB", 1, "");
} else {
WARNING("curl convenience functions not enabled; libraries and headers not found");
}
#if defined(ZTS)
HTTP_CURL_OPT(NOSIGNAL, 1);
#endif
+ HTTP_CURL_OPT(PRIVATE, request);
+ HTTP_CURL_OPT(ERRORBUFFER, request->_error);
HTTP_CURL_OPT(HEADER, 0);
HTTP_CURL_OPT(FILETIME, 1);
HTTP_CURL_OPT(AUTOREFERER, 1);
/* set options */
HTTP_CURL_OPT(DEBUGDATA, request);
HTTP_CURL_OPT(URL, request->url);
- HTTP_CURL_OPT(PRIVATE, request->url);
/* progress callback */
if ((zoption = http_request_option(request, options, "onprogress", 0))) {
TSRMLS_FETCH_FROM_CTX(request->tsrm_ls);
if (CURLE_OK != (result = curl_easy_perform(request->ch))) {
- http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s (%s)", curl_easy_strerror(result), request->url);
+ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(result), request->_error, request->url);
}
}
/* }}} */
if (CURLMSG_DONE == msg->msg) {
if (CURLE_OK != msg->data.result) {
http_request_pool_try {
- char *url = NULL;
- curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &url);
- http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s (%s)", curl_easy_strerror(msg->data.result), url);
+ http_request *r = NULL;
+ curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &r);
+ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(msg->data.result), r?r->_error:"", r?r->url:"");
} http_request_pool_catch();
}
http_request_pool_try {
#include "phpstr/phpstr.h"
#include "missing.h"
-
#ifdef HTTP_WANT_NETDB
# ifdef PHP_WIN32
# include <winsock2.h>
#if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL)
# ifdef PHP_WIN32
# include <winsock2.h>
+# define CURL_STATICLIB
# endif
# include <curl/curl.h>
#endif
struct curl_slist *headers;
} _cache;
+ char _error[CURL_ERROR_SIZE];
zval *_progress_callback;
#ifdef ZTS