} \
http_curl_initbuf(); \
http_curl_setopts(ch, URL, options);
-
+
#define http_curl_cleanup(ch, clean_curl) \
http_curl_freestr(); \
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);
if (Z_LVAL_P(zoption)) {
curl_easy_setopt(ch, CURLOPT_ENCODING, "");
}
- } else {
- curl_easy_setopt(ch, CURLOPT_ENCODING, "");
}
/* another port */
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);
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;
}
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);
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;
}
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);
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;
}
/* }}} */
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);
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;
}
/* }}} */