cvs: pecl /http http_curl_api.c
| From: | Michael Wallner | Date: | Sun, 10 Apr 2005 15:56:37 +0000 |
| Subject: | cvs: pecl /http http_curl_api.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-2956@lists.php.net to get a copy of this message | ||
mike Sun Apr 10 11:56:37 2005 EDT
Modified files:
/pecl/http http_curl_api.c
Log:
- error workaround
http://cvs.php.net/diff.php/pecl/http/http_curl_api.c?r1=1.25&r2=1.26&ty=u
Index: pecl/http/http_curl_api.c
diff -u pecl/http/http_curl_api.c:1.25 pecl/http/http_curl_api.c:1.26
--- pecl/http/http_curl_api.c:1.25 Thu Mar 24 11:50:10 2005
+++ pecl/http/http_curl_api.c Sun Apr 10 11:56:35 2005
@@ -13,7 +13,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: http_curl_api.c,v 1.25 2005/03/24 16:50:10 mike Exp $ */
+/* $Id: http_curl_api.c,v 1.26 2005/04/10 15:56:35 mike Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -25,15 +25,16 @@
#include <curl/curl.h>
+#include "phpstr/phpstr.h"
+
#include "php.h"
#include "php_http.h"
+#include "php_http_std_defs.h"
#include "php_http_api.h"
#include "php_http_curl_api.h"
-#include "php_http_std_defs.h"
-
-#include "phpstr/phpstr.h"
+#include "php_http_url_api.h"
-ZEND_DECLARE_MODULE_GLOBALS(http)
+ZEND_EXTERN_MODULE_GLOBALS(http)
#if LIBCURL_VERSION_NUM >= 0x070c01
# define http_curl_reset(ch) curl_easy_reset(ch)
@@ -42,7 +43,10 @@
#endif
#if LIBCURL_VERSION_NUM < 0x070c00
+# define http_curl_error(dummy) HTTP_G(curlerr)
# define curl_easy_strerror(code) "unkown error"
+#else
+# define http_curl_error(code) curl_easy_strerror(code)
#endif
#define http_curl_startup(ch, clean_curl, URL, options) \
@@ -108,7 +112,6 @@
static size_t http_curl_body_callback(char *buf, size_t len, size_t n, void *s)
{
TSRMLS_FETCH();
-
phpstr_append(&HTTP_G(curlbuf), buf, len *= n);
return len;
}
@@ -123,7 +126,6 @@
if (HTTP_G(curlbuf).used && (!strncmp(buf, "HTTP/1.",
sizeof("HTTP/1.") - 1))) {
phpstr_free(&HTTP_G(curlbuf));
}
-
phpstr_append(&HTTP_G(curlbuf), buf, len *= n);
return len;
}
@@ -174,6 +176,9 @@
#if defined(ZTS) && (LIBCURL_VERSION_NUM >= 0x070a00)
HTTP_CURL_OPT(NOSIGNAL, 1);
#endif
+#if LIBCURL_VERSION_NUM < 0x070c00
+ HTTP_CURL_OPT(ERRORBUFFER, HTTP_G(curlerr));
+#endif
if ((!options) || (1 > zend_hash_num_elements(options))) {
return;