X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_client_curl.c;h=a5af70dc426a96eca1aefbecf1ed5b87d7a1eb36;hp=fb8ecf678f3e5e07366f7e772fd18d6551704b2a;hb=76f74c9bfd2e97c89e7184d85ea7a0c5322a5219;hpb=f753226f1f45e10ef3916256ec1bc0416c8644a8 diff --git a/php_http_client_curl.c b/php_http_client_curl.c index fb8ecf6..a5af70d 100644 --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2011, Michael Wallner | + | Copyright (c) 2004-2013, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -986,7 +986,9 @@ static void php_http_curle_options_init(php_http_options_t *registry TSRMLS_DC) if ((opt = php_http_option_register(registry, ZEND_STRL("proxyauth"), CURLOPT_PROXYUSERPWD, IS_STRING))) { opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN; } - php_http_option_register(registry, ZEND_STRL("proxyauthtype"), CURLOPT_PROXYAUTH, IS_LONG); + if ((opt = php_http_option_register(registry, ZEND_STRL("proxyauthtype"), CURLOPT_PROXYAUTH, IS_LONG))) { + Z_LVAL(opt->defval) = CURLAUTH_ANYSAFE; + } php_http_option_register(registry, ZEND_STRL("proxytunnel"), CURLOPT_HTTPPROXYTUNNEL, IS_BOOL); #if PHP_HTTP_CURL_VERSION(7,19,4) php_http_option_register(registry, ZEND_STRL("noproxy"), CURLOPT_NOPROXY, IS_STRING); @@ -1044,7 +1046,9 @@ static void php_http_curle_options_init(php_http_options_t *registry TSRMLS_DC) if ((opt = php_http_option_register(registry, ZEND_STRL("httpauth"), CURLOPT_USERPWD, IS_STRING))) { opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN; } - php_http_option_register(registry, ZEND_STRL("httpauthtype"), CURLOPT_HTTPAUTH, IS_LONG); + if ((opt = php_http_option_register(registry, ZEND_STRL("httpauthtype"), CURLOPT_HTTPAUTH, IS_LONG))) { + Z_LVAL(opt->defval) = CURLAUTH_ANYSAFE; + } /* redirects */ if ((opt = php_http_option_register(registry, ZEND_STRL("redirect"), CURLOPT_FOLLOWLOCATION, IS_LONG))) { @@ -1862,10 +1866,11 @@ PHP_MINIT_FUNCTION(http_client_curl) { php_http_options_t *options; php_http_client_driver_t driver = { + ZEND_STRL("curl"), &php_http_client_curl_ops }; - if (SUCCESS != php_http_client_driver_add(ZEND_STRL("curl"), &driver)) { + if (SUCCESS != php_http_client_driver_add(&driver)) { return FAILURE; }