projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
* fixed/improved ranges support
[m6w6/ext-http]
/
http_curl_api.c
diff --git
a/http_curl_api.c
b/http_curl_api.c
index 6e96940daf7ad77da0c906f18286d4a0ab9a4623..3dc462cdc95a3f8d539121b0efdfc2d23fcd4802 100644
(file)
--- a/
http_curl_api.c
+++ b/
http_curl_api.c
@@
-45,6
+45,11
@@
ZEND_DECLARE_MODULE_GLOBALS(http)
# define http_curl_reset(ch)
#endif
# define http_curl_reset(ch)
#endif
+/* FIXXME: correct version where strerror is supported! */
+#if LIBCURL_VERSION_NUM < 0x070b01
+# define curl_easy_strerror(code) "unkown error"
+#endif
+
#define http_curl_startup(ch, clean_curl, URL, options) \
if (!ch) { \
if (!(ch = curl_easy_init())) { \
#define http_curl_startup(ch, clean_curl, URL, options) \
if (!ch) { \
if (!(ch = curl_easy_init())) { \
@@
-79,11
+84,15
@@
ZEND_DECLARE_MODULE_GLOBALS(http)
#define http_curl_freestr() \
zend_llist_clean(&HTTP_G(to_free))
#define http_curl_freestr() \
zend_llist_clean(&HTTP_G(to_free))
-#define http_curl_initbuf() http_curl_initbuf_ex(0)
+#define http_curl_initbuf() \
+ http_curl_initbuf_ex(0)
#define http_curl_initbuf_ex(chunk_size) \
{ \
#define http_curl_initbuf_ex(chunk_size) \
{ \
- size_t size = (chunk_size > 0) ? chunk_size : HTTP_CURLBUF_SIZE; \
+ size_t size = chunk_size; \
+ if (size < 1) { \
+ size = HTTP_CURLBUF_SIZE; \
+ } \
http_curl_freebuf(); \
HTTP_G(curlbuf).data = emalloc(size); \
HTTP_G(curlbuf).free = size; \
http_curl_freebuf(); \
HTTP_G(curlbuf).data = emalloc(size); \
HTTP_G(curlbuf).free = size; \