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)) || (PHP_HTTP_CURL_VERSION(7,42,0) && defined(PHP_HTTP_HAVE_GNUTLS))
+#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;
{
php_http_option_t *opt;
+ /* url options */
+#if PHP_HTTP_CURL_VERSION(7,42,0)
+ php_http_option_register(registry, ZEND_STRL("path_as_is"), CURLOPT_PATH_AS_IS, IS_BOOL);
+#endif
+
/* proxy */
if ((opt = php_http_option_register(registry, ZEND_STRL("proxyhost"), CURLOPT_PROXY, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
}
# endif
#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))
php_http_option_register(registry, ZEND_STRL("certinfo"), CURLOPT_CERTINFO, IS_BOOL);
#endif
#if PHP_HTTP_CURL_VERSION(7,36,0)
}
#endif
#if PHP_HTTP_CURL_VERSION(7,39,0)
+ /* FIXME: see http://curl.haxx.se/libcurl/c/CURLOPT_PINNEDPUBLICKEY.html#AVAILABILITY */
if ((opt = php_http_option_register(registry, ZEND_STRL("pinned_publickey"), CURLOPT_PINNEDPUBLICKEY, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR;
* See also https://tools.ietf.org/html/rfc7231#section-5.1.1
*/
if (PHP_HTTP_INFO(msg).request.method) {
- if (!strcasecmp("PUT", PHP_HTTP_INFO(msg).request.method)) {
+ switch(php_http_select_str(PHP_HTTP_INFO(msg).request.method, 2, "HEAD", "PUT")) {
+ case 0:
+ curl_easy_setopt(curl->handle, CURLOPT_NOBODY, 1L);
+ break;
+ case 1:
curl_easy_setopt(curl->handle, CURLOPT_UPLOAD, 1L);
- } else {
+ break;
+ default:
curl_easy_setopt(curl->handle, CURLOPT_CUSTOMREQUEST, PHP_HTTP_INFO(msg).request.method);
}
} else {
}
/* only if the client itself is setup for persistence */
- if (h->rf->dtor == (void (*)(void*)) php_persistent_handle_abandon) {
+ if (php_resource_factory_is_persistent(h->rf)) {
char *id_str = NULL;
size_t id_len;
int port = url->port ? url->port : 80;
}
if (pf) {
- rf = php_resource_factory_init(NULL, php_persistent_handle_get_resource_factory_ops(), pf, (void (*)(void*)) php_persistent_handle_abandon);
+ rf = php_persistent_handle_resource_factory_init(NULL, pf);
} else {
rf = php_resource_factory_init(NULL, &php_http_curle_resource_factory_ops, NULL, NULL);
}