{
case COPY_STRING:
{
- char *new_str = estrdup((const char*) data);
+ char *new_str = estrdup(data);
zend_llist_add_element(&HTTP_G(request).copies.strings, &new_str);
return new_str;
}
/* {{{ void http_request_data_free_string(char **) */
void _http_request_data_free_string(void *string)
{
+ //fprintf(stderr, "FREE STRING %p (%s)\n", *((char **)string), *((char **)string));
efree(*((char **)string));
}
/* }}} */
/* }}} */
/* {{{ STATUS http_request_init(CURL *, http_request_method, char *, http_request_body *, HashTable *, phpstr *) */
-PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, const char *url, http_request_body *body, HashTable *options, phpstr *response TSRMLS_DC)
+PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char *url, http_request_body *body, HashTable *options, phpstr *response TSRMLS_DC)
{
zval *zoption;
zend_bool range_req = 0;
/* set options */
if (url) {
- HTTP_CURL_OPT(URL, http_request_data_copy(COPY_STRING, (void *) url));
+ HTTP_CURL_OPT(URL, http_request_data_copy(COPY_STRING, url));
}
if (response) {
/* compress, empty string enables deflate and gzip */
if (zoption = http_curl_getopt(options, "compress", IS_BOOL)) {
if (Z_LVAL_P(zoption)) {
- HTTP_CURL_OPT(ENCODING, http_request_data_copy(COPY_STRING, ""));
+ HTTP_CURL_OPT(ENCODING, "");
}
}
if (zoption = http_curl_getopt(options, "useragent", IS_STRING)) {
HTTP_CURL_OPT(USERAGENT, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
} else {
- HTTP_CURL_OPT(USERAGENT, http_request_data_copy(COPY_STRING, "PECL::HTTP/" HTTP_PEXT_VERSION " (PHP/" PHP_VERSION ")"));
+ HTTP_CURL_OPT(USERAGENT, "PECL::HTTP/" HTTP_PEXT_VERSION " (PHP/" PHP_VERSION ")");
}
/* additional headers, array('name' => 'value') */
/* }}} */
/* {{{ STATUS http_request_ex(CURL *, http_request_method, char *, http_request_body, HashTable, HashTable, phpstr *) */
-PHP_HTTP_API STATUS _http_request_ex(CURL *ch, http_request_method meth, const char *url, http_request_body *body, HashTable *options, HashTable *info, phpstr *response TSRMLS_DC)
+PHP_HTTP_API STATUS _http_request_ex(CURL *ch, http_request_method meth, char *url, http_request_body *body, HashTable *options, HashTable *info, phpstr *response TSRMLS_DC)
{
STATUS status;
zend_bool clean_curl;