static STATUS php_http_curle_option_set_compress(php_http_option_t *opt, zval *val, void *userdata)
{
php_http_client_curl_handler_t *curl = userdata;
+ CURL *ch = curl->handle;
- if (Z_BVAL_P(val)) {
- curl->options.headers = curl_slist_append(curl->options.headers, "Accept-Encoding: gzip;q=1.0,deflate;q=0.5");
+ if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_ACCEPT_ENCODING, Z_BVAL_P(val) ? "" : NULL)) {
+ return FAILURE;
}
return SUCCESS;
}
ZVAL_BOOL(&opt->defval, 1);
opt->setter = php_http_curle_option_set_ssl_verifyhost;
}
+#if PHP_HTTP_CURL_VERSION(7,41,0)
+ php_http_option_register(registry, ZEND_STRL("verifystatus"), CURLOPT_SSL_VERIFYSTATUS, IS_BOOL);
+#endif
php_http_option_register(registry, ZEND_STRL("cipher_list"), CURLOPT_SSL_CIPHER_LIST, IS_STRING);
if ((opt = php_http_option_register(registry, ZEND_STRL("cainfo"), CURLOPT_CAINFO, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
}
}
+ /* apply options */
+ php_http_options_apply(&php_http_curle_options, enqueue->options, curl);
+
/* request headers */
php_http_message_update_headers(msg);
if (zend_hash_num_elements(&msg->hdrs)) {
curl_easy_setopt(curl->handle, CURLOPT_POSTFIELDSIZE, 0L);
}
- php_http_options_apply(&php_http_curle_options, enqueue->options, curl);
-
return SUCCESS;
}