X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_curl_client.c;h=c0930db8866aecd1f6a6233a145f5c61cb266fa8;hp=621e05b3d54b5587e388af31e7eaf03e7a480c92;hb=2a501676c41f8b78392fdf4cd33e9eeaf46736f4;hpb=25f0c16244fc5f8b2c9d9bfddab8a541d2521789 diff --git a/php_http_curl_client.c b/php_http_curl_client.c index 621e05b..c0930db 100644 --- a/php_http_curl_client.c +++ b/php_http_curl_client.c @@ -642,6 +642,7 @@ static STATUS php_http_curl_client_option_set_portrange(php_http_option_t *opt, return SUCCESS; } +#if PHP_HTTP_CURL_VERSION(7,21,3) static STATUS php_http_curl_client_option_set_resolve(php_http_option_t *opt, zval *val, void *userdata) { php_http_client_t *h = userdata; @@ -670,6 +671,7 @@ static STATUS php_http_curl_client_option_set_resolve(php_http_option_t *opt, zv } return SUCCESS; } +#endif static void php_http_curl_client_options_init(php_http_options_t *registry TSRMLS_DC) { @@ -1209,16 +1211,16 @@ PHP_HTTP_API STATUS php_http_curl_client_prepare(php_http_client_t *h, php_http_ } /* attach request body */ - if ((body_size = php_http_message_body_size(&msg->body))) { + if ((body_size = php_http_message_body_size(msg->body))) { /* RFC2616, section 4.3 (para. 4) states that »a message-body MUST NOT be included in a request if the * specification of the request method (section 5.1.1) does not allow sending an entity-body in request.« * Following the clause in section 5.1.1 (para. 2) that request methods »MUST be implemented with the * same semantics as those specified in section 9« reveal that not any single defined HTTP/1.1 method * does not allow a request body. */ - php_stream_rewind(php_http_message_body_stream(&msg->body)); - curl_easy_setopt(curl->handle, CURLOPT_IOCTLDATA, &msg->body); - curl_easy_setopt(curl->handle, CURLOPT_READDATA, &msg->body); + php_stream_rewind(php_http_message_body_stream(msg->body)); + curl_easy_setopt(curl->handle, CURLOPT_IOCTLDATA, msg->body); + curl_easy_setopt(curl->handle, CURLOPT_READDATA, msg->body); curl_easy_setopt(curl->handle, CURLOPT_INFILESIZE, body_size); curl_easy_setopt(curl->handle, CURLOPT_POSTFIELDSIZE, body_size); }