* melt http_api down
[m6w6/ext-http] / http_curl_api.c
index 24524ced68d42af020016b7df7d27b8fad825b27..288a08473ceb1e830cb8ecaa2f59d1e1c87d181a 100644 (file)
@@ -33,6 +33,7 @@
 #include "php_http.h"
 #include "php_http_api.h"
 #include "php_http_curl_api.h"
+#include "php_http_std_defs.h"
 
 #include "ext/standard/php_smart_str.h"
 
@@ -48,7 +49,7 @@ ZEND_DECLARE_MODULE_GLOBALS(http)
        } \
        http_curl_initbuf(); \
        http_curl_setopts(ch, URL, options);
-               
+
 
 #define http_curl_cleanup(ch, clean_curl) \
        http_curl_freestr(); \
@@ -98,7 +99,7 @@ ZEND_DECLARE_MODULE_GLOBALS(http)
                        HTTP_G(curlbuf).free += bsize; \
                } \
        }
-               
+
 
 #define http_curl_copystr(s) _http_curl_copystr((s) TSRMLS_CC)
 static inline char *_http_curl_copystr(const char *str TSRMLS_DC);
@@ -253,8 +254,6 @@ static inline void _http_curl_setopts(CURL *ch, const char *url, HashTable *opti
                if (Z_LVAL_P(zoption)) {
                        curl_easy_setopt(ch, CURLOPT_ENCODING, "");
                }
-       } else {
-               curl_easy_setopt(ch, CURLOPT_ENCODING, "");
        }
 
        /* another port */
@@ -506,7 +505,7 @@ PHP_HTTP_API STATUS _http_get_ex(CURL *ch, const char *URL, HashTable *options,
        HashTable *info, char **data, size_t *data_len TSRMLS_DC)
 {
        zend_bool clean_curl = 0;
-       
+
        http_curl_startup(ch, clean_curl, URL, options);
        curl_easy_setopt(ch, CURLOPT_NOBODY, 0);
        curl_easy_setopt(ch, CURLOPT_POST, 0);
@@ -516,14 +515,14 @@ PHP_HTTP_API STATUS _http_get_ex(CURL *ch, const char *URL, HashTable *options,
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not perform request");
                return FAILURE;
        }
-       
+
        if (info) {
                http_curl_getinfo(ch, info);
        }
-       
+
        http_curl_copybuf(data, data_len);
        http_curl_cleanup(ch, clean_curl);
-       
+
        return SUCCESS;
 }
 
@@ -532,7 +531,7 @@ PHP_HTTP_API STATUS _http_head_ex(CURL *ch, const char *URL, HashTable *options,
        HashTable *info, char **data, size_t *data_len TSRMLS_DC)
 {
        zend_bool clean_curl = 0;
-       
+
        http_curl_startup(ch, clean_curl, URL, options);
        curl_easy_setopt(ch, CURLOPT_NOBODY, 1);
        curl_easy_setopt(ch, CURLOPT_POST, 0);
@@ -542,14 +541,14 @@ PHP_HTTP_API STATUS _http_head_ex(CURL *ch, const char *URL, HashTable *options,
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not perform request");
                return FAILURE;
        }
-       
+
        if (info) {
                http_curl_getinfo(ch, info);
        }
-       
+
        http_curl_copybuf(data, data_len);
        http_curl_cleanup(ch, clean_curl);
-       
+
        return SUCCESS;
 }
 
@@ -559,7 +558,7 @@ PHP_HTTP_API STATUS _http_post_data_ex(CURL *ch, const char *URL, char *postdata
        size_t *data_len TSRMLS_DC)
 {
        zend_bool clean_curl = 0;
-       
+
        http_curl_startup(ch, clean_curl, URL, options);
        curl_easy_setopt(ch, CURLOPT_POST, 1);
        curl_easy_setopt(ch, CURLOPT_POSTFIELDS, postdata);
@@ -570,14 +569,14 @@ PHP_HTTP_API STATUS _http_post_data_ex(CURL *ch, const char *URL, char *postdata
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not perform request");
                return FAILURE;
        }
-       
+
        if (info) {
                http_curl_getinfo(ch, info);
        }
-       
+
        http_curl_copybuf(data, data_len);
        http_curl_cleanup(ch, clean_curl);
-       
+
        return SUCCESS;
 }
 /* }}} */
@@ -616,7 +615,7 @@ PHP_HTTP_API STATUS _http_post_curldata_ex(CURL *ch, const char *URL,
        char **data, size_t *data_len TSRMLS_DC)
 {
        zend_bool clean_curl = 0;
-       
+
        http_curl_startup(ch, clean_curl, URL, options);
        curl_easy_setopt(ch, CURLOPT_POST, 1);
        curl_easy_setopt(ch, CURLOPT_HTTPPOST, curldata);
@@ -626,14 +625,14 @@ PHP_HTTP_API STATUS _http_post_curldata_ex(CURL *ch, const char *URL,
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not perform request");
                return FAILURE;
        }
-       
+
        if (info) {
                http_curl_getinfo(ch, info);
        }
-       
+
        http_curl_copybuf(data, data_len);
        http_curl_cleanup(ch, clean_curl);
-       
+
        return SUCCESS;
 }
 /* }}} */
@@ -645,4 +644,4 @@ PHP_HTTP_API STATUS _http_post_curldata_ex(CURL *ch, const char *URL,
  * End:
  * vim600: noet sw=4 ts=4 fdm=marker
  * vim<600: noet sw=4 ts=4
- */
\ No newline at end of file
+ */