static int php_http_curle_seek_callback(void *userdata, curl_off_t offset, int origin)
{
php_http_message_body_t *body = userdata;
- TSRMLS_FETCH_FROM_CTX(body->ts);
if (!body) {
return 1;
case CURLSSLBACKEND_QSOSSL:
backend = "qsossl";
break;
-#endif
+#else
case CURLSSLBACKEND_GSKIT:
backend = "gskit";
break;
+#endif
case CURLSSLBACKEND_POLARSSL:
backend = "polarssl";
break;
}
#endif
-#if PHP_HTTP_CURL_VERSION(7,19,1) && defined(PHP_HTTP_HAVE_OPENSSL)
+#if (PHP_HTTP_CURL_VERSION(7,19,1) && defined(PHP_HTTP_HAVE_OPENSSL)) || (PHP_HTTP_CURL_VERSION(7,34,0) && defined(PHP_HTTP_HAVE_NSS)) || (PHP_HTTP_CURL_VERSION(7,42,0) && defined(PHP_HTTP_HAVE_GNUTLS)) || (PHP_HTTP_CURL_VERSION(7,39,0) && defined(PHP_HTTP_HAVE_GSKIT))
{
int i;
zval ci_array, subarray;
return handle == ((php_http_client_curl_handler_t *) e->opaque)->handle;
}
-static php_http_message_t *php_http_curlm_responseparser(php_http_client_curl_handler_t *h TSRMLS_DC)
+static php_http_message_t *php_http_curlm_responseparser(php_http_client_curl_handler_t *h)
{
php_http_message_t *response;
php_http_header_parser_t parser;
zval *zh;
- response = php_http_message_init(NULL, 0, h->response.body TSRMLS_CC);
- php_http_header_parser_init(&parser TSRMLS_CC);
+ response = php_http_message_init(NULL, 0, h->response.body);
+ php_http_header_parser_init(&parser);
while (h->response.headers.used) {
php_http_header_parser_state_t st = php_http_header_parser_parse(&parser,
&h->response.headers, PHP_HTTP_HEADER_PARSER_CLEANUP, &response->hdrs,
if ((enqueue = php_http_client_enqueued(context, msg->easy_handle, compare_queue))) {
php_http_client_curl_handler_t *handler = enqueue->opaque;
- php_http_message_t *response = php_http_curlm_responseparser(handler TSRMLS_CC);
+ php_http_message_t *response = php_http_curlm_responseparser(handler);
if (response) {
context->callback.response.func(context->callback.response.arg, context, &handler->queue, &response);
int i = 0;
do {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s; %s (%s)", curl_easy_strerror(err[i].errorcode), err[i].errorbuffer, STR_PTR(err[i].url));
+ php_error_docref(NULL, E_WARNING, "%s; %s (%s)", curl_easy_strerror(err[i].errorcode), err[i].errorbuffer, STR_PTR(err[i].url));
if (err[i].url) {
efree(err[i].url);
}
opt->setter = php_http_curle_option_set_proxyheader;
}
#endif
+#if PHP_HTTP_CURL_VERSION(7,43,0)
+ if ((opt = php_http_option_register(registry, ZEND_STRL("proxy_service_name"), CURLOPT_PROXY_SERVICE_NAME, IS_STRING))) {
+ opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
+ }
+#endif
#if PHP_HTTP_CURL_VERSION(7,40,0)
if ((opt = php_http_option_register(registry, ZEND_STRL("unix_socket_path"), CURLOPT_UNIX_SOCKET_PATH, IS_STRING))) {
if ((opt = php_http_option_register(registry, ZEND_STRL("httpauthtype"), CURLOPT_HTTPAUTH, IS_LONG))) {
Z_LVAL(opt->defval) = CURLAUTH_ANYSAFE;
}
+#if PHP_HTTP_CURL_VERSION(7,43,0)
+ if ((opt = php_http_option_register(registry, ZEND_STRL("service_name"), CURLOPT_SERVICE_NAME, IS_STRING))) {
+ opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
+ }
+#endif
/* redirects */
if ((opt = php_http_option_register(registry, ZEND_STRL("redirect"), CURLOPT_FOLLOWLOCATION, IS_LONG))) {
}
# endif
#endif
-#if PHP_HTTP_CURL_VERSION(7,19,1) && defined(PHP_HTTP_HAVE_OPENSSL)
- php_http_option_register(registry, ZEND_STRL("certinfo"), CURLOPT_CERTINFO, _IS_BOOL);
+#if (PHP_HTTP_CURL_VERSION(7,19,1) && defined(PHP_HTTP_HAVE_OPENSSL)) || (PHP_HTTP_CURL_VERSION(7,34,0) && defined(PHP_HTTP_HAVE_NSS)) || (PHP_HTTP_CURL_VERSION(7,42,0) && defined(PHP_HTTP_HAVE_GNUTLS)) || (PHP_HTTP_CURL_VERSION(7,39,0) && defined(PHP_HTTP_HAVE_GSKIT))
+ if ((opt = php_http_option_register(registry, ZEND_STRL("certinfo"), CURLOPT_CERTINFO, _IS_BOOL))) {
+ ZVAL_FALSE(&opt->defval);
+ }
#endif
#if PHP_HTTP_CURL_VERSION(7,36,0)
if ((opt = php_http_option_register(registry, ZEND_STRL("enable_npn"), CURLOPT_SSL_ENABLE_NPN, _IS_BOOL))) {
if ((opt = php_http_option_register(registry, ZEND_STRL("tlsauthpass"), CURLOPT_TLSAUTH_PASSWORD, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
}
+#endif
+#if PHP_HTTP_CURL_VERSION(7,42,0) && (defined(PHP_HTTP_HAVE_NSS) || defined(PHP_HTTP_HAVE_DARWINSSL))
+ php_http_option_register(registry, ZEND_STRL("falsestart"), CURLOPT_SSL_FALSESTART, _IS_BOOL);
#endif
}
}
CURLM *ch = curl->handle;
HashTable tmp_ht;
char **bl = NULL;
- TSRMLS_FETCH_FROM_CTX(client->ts);
/* array of char *, ending with a NULL */
if (value && Z_TYPE_P(value) != IS_NULL) {
}
#endif
-static void php_http_curlm_options_init(php_http_options_t *registry TSRMLS_DC)
+static void php_http_curlm_options_init(php_http_options_t *registry)
{
php_http_option_t *opt;
}
if (rv != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not set option %s (%s)", opt->name->val, curl_easy_strerror(rc));
+ php_error_docref(NULL, E_NOTICE, "Could not set option %s (%s)", opt->name->val, curl_easy_strerror(rc));
}
return rv;
}
curl_easy_setopt(curl->handle, CURLOPT_CUSTOMREQUEST, PHP_HTTP_INFO(msg).request.method);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot use empty request method");
+ php_error_docref(NULL, E_WARNING, "Cannot use empty request method");
return FAILURE;
}
static ZEND_RESULT_CODE php_http_client_curl_getopt(php_http_client_t *h, php_http_client_getopt_opt_t opt, void *arg, void **res)
{
php_http_client_enqueue_t *enqueue;
- TSRMLS_FETCH_FROM_CTX(h->ts);
switch (opt) {
case PHP_HTTP_CLIENT_OPT_PROGRESS_INFO:
break;
case PHP_HTTP_CLIENT_OPT_AVAILABLE_OPTIONS:
- zend_hash_apply_with_arguments(&php_http_curle_options.options TSRMLS_CC, apply_available_options, 1, *(HashTable **) res);
+ zend_hash_apply_with_arguments(&php_http_curle_options.options, apply_available_options, 1, *(HashTable **) res);
break;
case PHP_HTTP_CLIENT_OPT_AVAILABLE_CONFIGURATION:
- zend_hash_apply_with_arguments(&php_http_curlm_options.options TSRMLS_CC, apply_available_options, 1, *(HashTable **) res);
+ zend_hash_apply_with_arguments(&php_http_curlm_options.options, apply_available_options, 1, *(HashTable **) res);
break;
default: