Merge branch 'master' into phpng
authorMichael Wallner <mike@php.net>
Fri, 7 Aug 2015 09:36:04 +0000 (11:36 +0200)
committerMichael Wallner <mike@php.net>
Fri, 7 Aug 2015 09:36:04 +0000 (11:36 +0200)
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

1  2 
config9.m4
php_http_client_curl.c
php_http_env_request.c
php_http_header_parser.c
php_http_querystring.c
php_http_url.c
tests/helper/server.inc

diff --cc config9.m4
Simple merge
@@@ -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
                if ((opt = php_http_option_register(registry, ZEND_STRL("tlsauthpass"), CURLOPT_TLSAUTH_PASSWORD, IS_STRING))) {
                        opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
                }
 -              php_http_option_register(registry, ZEND_STRL("falsestart"), CURLOPT_SSL_FALSESTART, IS_BOOL);
+ #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
        }
  }
@@@ -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); \
@@@ -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);
                                        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 */
Simple merge
diff --cc php_http_url.c
Simple merge
Simple merge