From: Michael Wallner Date: Fri, 7 Aug 2015 09:36:04 +0000 (+0200) Subject: Merge branch 'master' into phpng X-Git-Tag: RELEASE_3_0_0_RC1~36 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=1f37d09e4c7f55cf6f2c3c10ea3ec2424a482671 Merge branch 'master' into phpng Conflicts: php_http_client.c php_http_client_curl.c php_http_env_request.c php_http_env_response.c php_http_header_parser.c --- 1f37d09e4c7f55cf6f2c3c10ea3ec2424a482671 diff --cc php_http_client_curl.c index cb53064,78c552a..a4e84ce --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@@ -554,10 -529,10 +555,10 @@@ static ZEND_RESULT_CODE php_http_curle_ } #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; + zval ci_array, subarray; struct curl_certinfo *ci; char *colon, *keyname; @@@ -1503,14 -1499,14 +1514,16 @@@ static void php_http_curle_options_init } # 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)) - php_http_option_register(registry, ZEND_STRL("certinfo"), CURLOPT_CERTINFO, IS_BOOL); ++ 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("enable_npn"), CURLOPT_SSL_ENABLE_NPN, _IS_BOOL))) { ZVAL_BOOL(&opt->defval, 1); } - if ((opt = php_http_option_register(registry, ZEND_STRL("enable_alpn"), CURLOPT_SSL_ENABLE_ALPN, IS_BOOL))) { + if ((opt = php_http_option_register(registry, ZEND_STRL("enable_alpn"), CURLOPT_SSL_ENABLE_ALPN, _IS_BOOL))) { ZVAL_BOOL(&opt->defval, 1); } #endif @@@ -1530,6 -1526,9 +1543,9 @@@ 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); ++ php_http_option_register(registry, ZEND_STRL("falsestart"), CURLOPT_SSL_FALSESTART, _IS_BOOL); #endif } } diff --cc php_http_env_request.c index 5f1d130,a884d2f..0ee68f4 --- a/php_http_env_request.c +++ b/php_http_env_request.c @@@ -162,18 -172,18 +162,19 @@@ static PHP_METHOD(HttpEnvRequest, __con do {\ zend_fcall_info fci; \ zend_fcall_info_cache fcc; \ - zval *rv = NULL, mn, ***args = ecalloc(sizeof(zval **), ZEND_NUM_ARGS()); \ - zval *qs = zend_read_property(Z_OBJCE_P(getThis()), getThis(), ZEND_STRL(prop), 0 TSRMLS_CC); \ + zval rv, mn, *args = ecalloc(sizeof(zval), ZEND_NUM_ARGS()); \ + zval *this_ptr = getThis(); \ + zval qs_tmp, *qs = zend_read_property(Z_OBJCE_P(this_ptr), this_ptr, ZEND_STRL(prop), 0, &qs_tmp); \ \ - INIT_PZVAL(&mn); \ ++ ZVAL_NULL(&rv); \ array_init(&mn); \ - Z_ADDREF_P(qs); \ + Z_TRY_ADDREF_P(qs); \ add_next_index_zval(&mn, qs); \ - add_next_index_stringl(&mn, ZEND_STRL("get"), 1); \ - zend_fcall_info_init(&mn, 0, &fci, &fcc, NULL, NULL TSRMLS_CC); \ + add_next_index_stringl(&mn, ZEND_STRL("get")); \ + zend_fcall_info_init(&mn, 0, &fci, &fcc, NULL, NULL); \ zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args); \ - zend_fcall_info_argp(&fci TSRMLS_CC, ZEND_NUM_ARGS(), args); \ - zend_fcall_info_call(&fci, &fcc, &rv, NULL TSRMLS_CC); \ + zend_fcall_info_argp(&fci, ZEND_NUM_ARGS(), args); \ + zend_fcall_info_call(&fci, &fcc, &rv, NULL); \ zend_fcall_info_args_clear(&fci, 1); \ efree(args); \ zval_dtor(&mn); \ diff --cc php_http_header_parser.c index e1ebe12,46551e2..5dfaedd --- a/php_http_header_parser.c +++ b/php_http_header_parser.c @@@ -145,10 -153,10 +148,10 @@@ php_http_header_parser_state_t php_http /* end of headers */ php_http_buffer_cut(buffer, 0, eol_len); php_http_header_parser_state_push(parser, 1, PHP_HTTP_HEADER_PARSER_STATE_DONE); - } else if (php_http_info_parse(&parser->info, php_http_buffer_fix(buffer)->data)) { - } else if (php_http_info_parse(&parser->info, buffer->data TSRMLS_CC)) { ++ } else if (php_http_info_parse(&parser->info, buffer->data)) { /* new message starting with request/response line */ if (callback_func) { - callback_func(callback_arg, &headers, &parser->info TSRMLS_CC); + callback_func(callback_arg, &headers, &parser->info); } php_http_info_dtor(&parser->info); php_http_buffer_cut(buffer, 0, eol_str + eol_len - buffer->data); @@@ -171,8 -179,7 +174,7 @@@ php_http_header_parser_state_push(parser, 1, PHP_HTTP_HEADER_PARSER_STATE_VALUE); } else if (eol_str || (flags & PHP_HTTP_HEADER_PARSER_CLEANUP)) { /* neither reqeust/response line nor 'header:' string, or injected new line or NUL etc. */ - php_http_buffer_fix(buffer); - php_http_header_parser_error(strspn(buffer->data, PHP_HTTP_HEADER_NAME_CHARS), buffer->data, buffer->used, eol_str TSRMLS_CC); + php_http_header_parser_error(strspn(buffer->data, PHP_HTTP_HEADER_NAME_CHARS), buffer->data, buffer->used, eol_str); return php_http_header_parser_state_push(parser, 1, PHP_HTTP_HEADER_PARSER_STATE_FAILURE); } else { /* keep feeding */