diff options
| author | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
|---|---|---|
| committer | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
| commit | e63a8540a60e95aa5bd8e269add1b02afcc1b79b (patch) | |
| tree | b83a144eec24cc81adab0b9a778f7a730d8df79e /ext/curl | |
| parent | 7a4cc73641bb3eb878f7184bcbd026ee663cf2a9 (diff) | |
| parent | 53071e647049f099f7f7a0771ddb63fc2cdd621c (diff) | |
| download | php-git-e63a8540a60e95aa5bd8e269add1b02afcc1b79b.tar.gz | |
Merge branch 'openssl_error_store' into openssl_aead
Diffstat (limited to 'ext/curl')
| -rw-r--r-- | ext/curl/interface.c | 224 | ||||
| -rw-r--r-- | ext/curl/multi.c | 7 | ||||
| -rw-r--r-- | ext/curl/tests/bug68937.phpt | 8 | ||||
| -rw-r--r-- | ext/curl/tests/bug68937_2.phpt | 7 | ||||
| -rw-r--r-- | ext/curl/tests/bug72202.phpt | 36 | ||||
| -rw-r--r-- | ext/curl/tests/check_win_config.phpt | 3 |
6 files changed, 256 insertions, 29 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 564d9fcb1c..072c23e48d 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -568,6 +568,13 @@ PHP_MINFO_FUNCTION(curl) #if LIBCURL_VERSION_NUM >= 0x072600 /* 7.38.0 */ {"GSSAPI", CURL_VERSION_GSSAPI}, #endif +#if LIBCURL_VERSION_NUM >= 0x072800 /* 7.40.0 */ + {"KERBEROS5", CURL_VERSION_KERBEROS5}, + {"UNIX_SOCKETS", CURL_VERSION_UNIX_SOCKETS}, +#endif +#if LIBCURL_VERSION_NUM >= 0x072f00 /* 7.47.0 */ + {"PSL", CURL_VERSION_PSL}, +#endif {NULL, 0} }; @@ -838,17 +845,15 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLM_INTERNAL_ERROR); REGISTER_CURL_CONSTANT(CURLM_OK); REGISTER_CURL_CONSTANT(CURLM_OUT_OF_MEMORY); +#if LIBCURL_VERSION_NUM >= 0x072001 /* Available since 7.32.1 */ + REGISTER_CURL_CONSTANT(CURLM_ADDED_ALREADY); +#endif /* Curl proxy constants */ REGISTER_CURL_CONSTANT(CURLPROXY_HTTP); REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4); REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5); -#if LIBCURL_VERSION_NUM >= 0x071200 /* Available since 7.18.0 */ - REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4A); - REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5_HOSTNAME); -#endif - /* Curl Share constants */ REGISTER_CURL_CONSTANT(CURLSHOPT_NONE); REGISTER_CURL_CONSTANT(CURLSHOPT_SHARE); @@ -857,9 +862,6 @@ PHP_MINIT_FUNCTION(curl) /* Curl Http Version constants (CURLOPT_HTTP_VERSION) */ REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_0); REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_1); -#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */ - REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2_0); -#endif REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_NONE); /* Curl Lock constants */ @@ -889,9 +891,6 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURL_VERSION_KERBEROS4); REGISTER_CURL_CONSTANT(CURL_VERSION_LIBZ); REGISTER_CURL_CONSTANT(CURL_VERSION_SSL); -#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */ - REGISTER_CURL_CONSTANT(CURL_VERSION_HTTP2); -#endif #if LIBCURL_VERSION_NUM >= 0x070a06 /* Available since 7.10.6 */ REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH); @@ -996,6 +995,7 @@ PHP_MINIT_FUNCTION(curl) #endif #if LIBCURL_VERSION_NUM >= 0x071000 /* Available since 7.16.0 */ + REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT_BADFILE); REGISTER_CURL_CONSTANT(CURLOPT_SSL_SESSIONID_CACHE); REGISTER_CURL_CONSTANT(CURLMOPT_PIPELINING); #endif @@ -1053,6 +1053,9 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLPAUSE_SEND_CONT); REGISTER_CURL_CONSTANT(CURL_READFUNC_PAUSE); REGISTER_CURL_CONSTANT(CURL_WRITEFUNC_PAUSE); + + REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4A); + REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5_HOSTNAME); #endif #if LIBCURL_VERSION_NUM >= 0x071202 /* Available since 7.18.2 */ @@ -1085,6 +1088,9 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLOPT_PROXYPASSWORD); REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERNAME); REGISTER_CURL_CONSTANT(CURLOPT_USERNAME); + REGISTER_CURL_CONSTANT(CURL_REDIR_POST_301); + REGISTER_CURL_CONSTANT(CURL_REDIR_POST_302); + REGISTER_CURL_CONSTANT(CURL_REDIR_POST_ALL); #endif #if LIBCURL_VERSION_NUM >= 0x071303 /* Available since 7.19.3 */ @@ -1114,6 +1120,12 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLPROTO_SFTP); REGISTER_CURL_CONSTANT(CURLPROTO_TELNET); REGISTER_CURL_CONSTANT(CURLPROTO_TFTP); + + REGISTER_CURL_CONSTANT(CURLPROXY_HTTP_1_0); + + REGISTER_CURL_CONSTANT(CURLFTP_CREATE_DIR); + REGISTER_CURL_CONSTANT(CURLFTP_CREATE_DIR_NONE); + REGISTER_CURL_CONSTANT(CURLFTP_CREATE_DIR_RETRY); #endif #if LIBCURL_VERSION_NUM >= 0x071306 /* Available since 7.19.6 */ @@ -1149,8 +1161,8 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURL_RTSPREQ_PLAY); REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECEIVE); REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECORD); - REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SETUP); REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SET_PARAMETER); + REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SETUP); REGISTER_CURL_CONSTANT(CURL_RTSPREQ_TEARDOWN); #endif @@ -1193,6 +1205,7 @@ PHP_MINIT_FUNCTION(curl) #endif #if LIBCURL_VERSION_NUM >= 0x071600 /* Available since 7.22.0 */ + REGISTER_CURL_CONSTANT(CURLAUTH_NTLM_WB); REGISTER_CURL_CONSTANT(CURLGSSAPI_DELEGATION_FLAG); REGISTER_CURL_CONSTANT(CURLGSSAPI_DELEGATION_POLICY_FLAG); REGISTER_CURL_CONSTANT(CURLOPT_GSSAPI_DELEGATION); @@ -1212,18 +1225,119 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLSSLOPT_ALLOW_BEAST); #endif +#if LIBCURL_VERSION_NUM >= 0x071901 /* Available since 7.25.1 */ + REGISTER_CURL_CONSTANT(CURL_REDIR_POST_303); +#endif + +#if LIBCURL_VERSION_NUM >= 0x071c00 /* Available since 7.28.0 */ + REGISTER_CURL_CONSTANT(CURLSSH_AUTH_AGENT); +#endif + +#if LIBCURL_VERSION_NUM >= 0x071e00 /* Available since 7.30.0 */ + REGISTER_CURL_CONSTANT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE); + REGISTER_CURL_CONSTANT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE); + REGISTER_CURL_CONSTANT(CURLMOPT_MAX_HOST_CONNECTIONS); + REGISTER_CURL_CONSTANT(CURLMOPT_MAX_PIPELINE_LENGTH); + REGISTER_CURL_CONSTANT(CURLMOPT_MAX_TOTAL_CONNECTIONS); +#endif + +#if LIBCURL_VERSION_NUM >= 0x071f00 /* Available since 7.31.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_SASL_IR); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072100 /* Available since 7.33.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_DNS_INTERFACE); + REGISTER_CURL_CONSTANT(CURLOPT_DNS_LOCAL_IP4); + REGISTER_CURL_CONSTANT(CURLOPT_DNS_LOCAL_IP6); + REGISTER_CURL_CONSTANT(CURLOPT_XOAUTH2_BEARER); + + REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2_0); + REGISTER_CURL_CONSTANT(CURL_VERSION_HTTP2); +#endif + #if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_LOGIN_OPTIONS); + REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_0); REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_1); REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_2); #endif -#if LIBCURL_VERSION_NUM >= 0x072B00 /* Available since 7.43.0 */ +#if LIBCURL_VERSION_NUM >= 0x072400 /* Available since 7.36.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_EXPECT_100_TIMEOUT_MS); + REGISTER_CURL_CONSTANT(CURLOPT_SSL_ENABLE_ALPN); + REGISTER_CURL_CONSTANT(CURLOPT_SSL_ENABLE_NPN); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */ + REGISTER_CURL_CONSTANT(CURLHEADER_SEPARATE); + REGISTER_CURL_CONSTANT(CURLHEADER_UNIFIED); + REGISTER_CURL_CONSTANT(CURLOPT_HEADEROPT); + REGISTER_CURL_CONSTANT(CURLOPT_PROXYHEADER); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072600 /* Available since 7.38.0 */ + REGISTER_CURL_CONSTANT(CURLAUTH_NEGOTIATE); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072700 /* Available since 7.39.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_PINNEDPUBLICKEY); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_UNIX_SOCKET_PATH); + + REGISTER_CURL_CONSTANT(CURLPROTO_SMB); + REGISTER_CURL_CONSTANT(CURLPROTO_SMBS); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072900 /* Available since 7.41.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYSTATUS); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072a00 /* Available since 7.42.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_PATH_AS_IS); + REGISTER_CURL_CONSTANT(CURLOPT_SSL_FALSESTART); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072b00 /* Available since 7.43.0 */ + REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2); + + REGISTER_CURL_CONSTANT(CURLOPT_PIPEWAIT); + REGISTER_CURL_CONSTANT(CURLOPT_PROXY_SERVICE_NAME); + REGISTER_CURL_CONSTANT(CURLOPT_SERVICE_NAME); + REGISTER_CURL_CONSTANT(CURLPIPE_NOTHING); REGISTER_CURL_CONSTANT(CURLPIPE_HTTP1); REGISTER_CURL_CONSTANT(CURLPIPE_MULTIPLEX); #endif +#if LIBCURL_VERSION_NUM >= 0x072c00 /* Available since 7.44.0 */ + REGISTER_CURL_CONSTANT(CURLSSLOPT_NO_REVOKE); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072d00 /* Available since 7.45.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_DEFAULT_PROTOCOL); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072e00 /* Available since 7.46.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_STREAM_WEIGHT); +#endif + +#if LIBCURL_VERSION_NUM >= 0x072f00 /* Available since 7.47.0 */ + REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2TLS); +#endif + +#if LIBCURL_VERSION_NUM >= 0x073000 /* Available since 7.48.0 */ + REGISTER_CURL_CONSTANT(CURLOPT_TFTP_NO_OPTIONS); +#endif + +#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */ + REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE); + REGISTER_CURL_CONSTANT(CURLOPT_CONNECT_TO); + REGISTER_CURL_CONSTANT(CURLOPT_TCP_FASTOPEN); +#endif + #if CURLOPT_FTPASCII != 0 REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII); #endif @@ -1335,14 +1449,12 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx) ZVAL_STRINGL(&argv[1], data, length); fci.size = sizeof(fci); - fci.function_table = EG(function_table); fci.object = NULL; ZVAL_COPY_VALUE(&fci.function_name, &t->func_name); fci.retval = &retval; fci.param_count = 2; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1386,14 +1498,12 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string) ZVAL_STRING(&argv[2], string); fci.size = sizeof(fci); - fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, &t->func_name); fci.object = NULL; fci.retval = &retval; fci.param_count = 3; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1443,14 +1553,12 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double ZVAL_LONG(&argv[4], (zend_long)ulnow); fci.size = sizeof(fci); - fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, &t->func_name); fci.object = NULL; fci.retval = &retval; fci.param_count = 5; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1506,14 +1614,12 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) ZVAL_LONG(&argv[2], (int)size * nmemb); fci.size = sizeof(fci); - fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, &t->func_name); fci.object = NULL; fci.retval = &retval; fci.param_count = 3; fci.params = argv; fci.no_separation = 0; - fci.symbol_table = NULL; ch->in_callback = 1; error = zend_call_function(&fci, &t->fci_cache); @@ -1574,9 +1680,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx ZVAL_STRINGL(&argv[1], data, length); fci.size = sizeof(fci); - fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fci.function_name, &t->func_name); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &retval; fci.param_count = 2; @@ -2146,7 +2250,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ case CURLOPT_CERTINFO: #endif #if LIBCURL_VERSION_NUM >= 0x071304 /* Available since 7.19.4 */ - case CURLOPT_NOPROXY: case CURLOPT_PROTOCOLS: case CURLOPT_REDIR_PROTOCOLS: case CURLOPT_SOCKS5_GSSAPI_NEC: @@ -2176,6 +2279,36 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ case CURLOPT_TCP_KEEPIDLE: case CURLOPT_TCP_KEEPINTVL: #endif +#if LIBCURL_VERSION_NUM >= 0x071f00 /* Available since 7.31.0 */ + case CURLOPT_SASL_IR: +#endif +#if LIBCURL_VERSION_NUM >= 0x072400 /* Available since 7.36.0 */ + case CURLOPT_EXPECT_100_TIMEOUT_MS: + case CURLOPT_SSL_ENABLE_ALPN: + case CURLOPT_SSL_ENABLE_NPN: +#endif +#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */ + case CURLOPT_HEADEROPT: +#endif +#if LIBCURL_VERSION_NUM >= 0x072900 /* Available since 7.41.0 */ + case CURLOPT_SSL_VERIFYSTATUS: +#endif +#if LIBCURL_VERSION_NUM >= 0x072a00 /* Available since 7.42.0 */ + case CURLOPT_PATH_AS_IS: + case CURLOPT_SSL_FALSESTART: +#endif +#if LIBCURL_VERSION_NUM >= 0x072b00 /* Available since 7.43.0 */ + case CURLOPT_PIPEWAIT: +#endif +#if LIBCURL_VERSION_NUM >= 0x072e00 /* Available since 7.46.0 */ + case CURLOPT_STREAM_WEIGHT: +#endif +#if LIBCURL_VERSION_NUM >= 0x073000 /* Available since 7.48.0 */ + case CURLOPT_TFTP_NO_OPTIONS: +#endif +#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */ + case CURLOPT_TCP_FASTOPEN: +#endif #if CURLOPT_MUTE != 0 case CURLOPT_MUTE: #endif @@ -2237,6 +2370,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ case CURLOPT_USERNAME: #endif #if LIBCURL_VERSION_NUM >= 0x071304 /* Available since 7.19.4 */ + case CURLOPT_NOPROXY: case CURLOPT_SOCKS5_GSSAPI_SERVICE: #endif #if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */ @@ -2260,6 +2394,19 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ #if LIBCURL_VERSION_NUM >= 0x071900 /* Available since 7.25.0 */ case CURLOPT_MAIL_AUTH: #endif +#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */ + case CURLOPT_LOGIN_OPTIONS: +#endif +#if LIBCURL_VERSION_NUM >= 0x072700 /* Available since 7.39.0 */ + case CURLOPT_PINNEDPUBLICKEY: +#endif +#if LIBCURL_VERSION_NUM >= 0x072b00 /* Available since 7.43.0 */ + case CURLOPT_PROXY_SERVICE_NAME: + case CURLOPT_SERVICE_NAME: +#endif +#if LIBCURL_VERSION_NUM >= 0x072d00 /* Available since 7.45.0 */ + case CURLOPT_DEFAULT_PROTOCOL: +#endif { zend_string *str = zval_get_string(zvalue); int ret = php_curl_option_str(ch, option, ZSTR_VAL(str), ZSTR_LEN(str), 0); @@ -2277,6 +2424,15 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ #if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */ case CURLOPT_RTSP_SESSION_ID: #endif +#if LIBCURL_VERSION_NUM >= 0x072100 /* Available since 7.33.0 */ + case CURLOPT_DNS_INTERFACE: + case CURLOPT_DNS_LOCAL_IP4: + case CURLOPT_DNS_LOCAL_IP6: + case CURLOPT_XOAUTH2_BEARER: +#endif +#if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */ + case CURLOPT_UNIX_SOCKET_PATH: +#endif #if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */ case CURLOPT_KRBLEVEL: #else @@ -2422,6 +2578,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ #if LIBCURL_VERSION_NUM >= 0x071503 /* Available since 7.21.3 */ case CURLOPT_RESOLVE: #endif +#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */ + case CURLOPT_PROXYHEADER: +#endif +#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */ + case CURLOPT_CONNECT_TO: +#endif { zval *current; HashTable *ph; @@ -2460,6 +2622,16 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ name = "CURLOPT_RESOLVE"; break; #endif +#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */ + case CURLOPT_PROXYHEADER: + name = "CURLOPT_PROXYHEADER"; + break; +#endif +#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */ + case CURLOPT_CONNECT_TO: + name = "CURLOPT_CONNECT_TO"; + break; +#endif } php_error_docref(NULL, E_WARNING, "You must pass either an object or an array with the %s argument", name); return FAILURE; @@ -3182,9 +3354,7 @@ PHP_FUNCTION(curl_close) return; } - if (Z_REFCOUNT_P(zid) <= 2) { - zend_list_close(Z_RES_P(zid)); - } + zend_list_close(Z_RES_P(zid)); } /* }}} */ diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 641d20f903..ab6d56c438 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -417,6 +417,13 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue, #if LIBCURL_VERSION_NUM >= 0x071003 /* 7.16.3 */ case CURLMOPT_MAXCONNECTS: #endif +#if LIBCURL_VERSION_NUM >= 0x071e00 /* 7.30.0 */ + case CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE: + case CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE: + case CURLMOPT_MAX_HOST_CONNECTIONS: + case CURLMOPT_MAX_PIPELINE_LENGTH: + case CURLMOPT_MAX_TOTAL_CONNECTIONS: +#endif error = curl_multi_setopt(mh->multi, option, zval_get_long(zvalue)); break; diff --git a/ext/curl/tests/bug68937.phpt b/ext/curl/tests/bug68937.phpt index 139cc17abd..0f346cf3fa 100644 --- a/ext/curl/tests/bug68937.phpt +++ b/ext/curl/tests/bug68937.phpt @@ -8,13 +8,19 @@ include 'skipif.inc'; --FILE-- <?php -$ch = curl_init('http://www.google.com/'); +include 'server.inc'; +$host = curl_cli_server_start(); + +$url = "{$host}/get.php"; + +$ch = curl_init($url); curl_setopt_array($ch, array( CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_INFILESIZE => 1, CURLOPT_HTTPHEADER => array( + 'Expect:', 'Content-Length: 1', ), CURLOPT_READFUNCTION => 'curl_read', diff --git a/ext/curl/tests/bug68937_2.phpt b/ext/curl/tests/bug68937_2.phpt index 29851ec6e1..c25da3fd71 100644 --- a/ext/curl/tests/bug68937_2.phpt +++ b/ext/curl/tests/bug68937_2.phpt @@ -7,8 +7,12 @@ include 'skipif.inc'; ?> --FILE-- <?php +include 'server.inc'; +$host = curl_cli_server_start(); -$ch = curl_init('http://www.google.com/'); +$url = "{$host}/get.php"; + +$ch = curl_init($url); curl_setopt_array($ch, array( CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, @@ -16,6 +20,7 @@ curl_setopt_array($ch, array( CURLOPT_INFILESIZE => filesize(__FILE__), CURLOPT_INFILE => fopen(__FILE__, 'r'), CURLOPT_HTTPHEADER => array( + 'Expect:', 'Content-Length: 1', ), CURLOPT_READFUNCTION => 'curl_read', diff --git a/ext/curl/tests/bug72202.phpt b/ext/curl/tests/bug72202.phpt new file mode 100644 index 0000000000..63138d9ba6 --- /dev/null +++ b/ext/curl/tests/bug72202.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #72202 (curl_close doesn't close cURL handle) +--SKIPIF-- +<?php +if (!extension_loaded("curl")) { + exit("skip curl extension not loaded"); +} +if (getenv("SKIP_ONLINE_TESTS")) { + die("skip online test"); +} +?> +--FILE-- +<?php +$a = fopen(__FILE__, "r"); +$b = $a; +var_dump($a, $b); +fclose($a); +var_dump($a, $b); +unset($a, $b); + +$a = curl_init(); +$b = $a; +var_dump($a, $b); +curl_close($a); +var_dump($a, $b); +unset($a, $b); +?> +--EXPECTF-- +resource(%d) of type (stream) +resource(%d) of type (stream) +resource(%d) of type (Unknown) +resource(%d) of type (Unknown) +resource(%d) of type (curl) +resource(%d) of type (curl) +resource(%d) of type (Unknown) +resource(%d) of type (Unknown) diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index 3d13638f90..fc1c66609a 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -42,6 +42,9 @@ SSPI => Yes TLS-SRP => No
HTTP2 => No
GSSAPI => No
+KERBEROS5 => Yes
+UNIX_SOCKETS => No
+PSL => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host => %s-pc-win32
SSL Version => OpenSSL/%s
|
