Commit:    1af8b3f8836bd8fb997ebfead82cbf21d33ed916
Author:    zoe slattery <z...@php.net>         Tue, 15 May 2012 11:05:20 +0100
Parents:   3332943c9d20a8b5e09816b11f38742de0e16085
Branches:  PHP-5.3 PHP-5.4 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=1af8b3f8836bd8fb997ebfead82cbf21d33ed916

Log:
Change impl of GZIP_POST, DEFLATE_POST. See #62021

Bugs:
https://bugs.php.net/62021

Changed paths:
  M  ext/soap/tests/server019.phpt
  M  ext/soap/tests/server020.phpt
  M  run-tests.php


Diff:
diff --git a/ext/soap/tests/server019.phpt b/ext/soap/tests/server019.phpt
index defdac5..d36cff0 100644
--- a/ext/soap/tests/server019.phpt
+++ b/ext/soap/tests/server019.phpt
@@ -8,7 +8,7 @@ SOAP Server 19: compressed request (gzip)
 ?>
 --INI--
 precision=14
---POST--
+--GZIP_POST--
 <SOAP-ENV:Envelope
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
@@ -19,8 +19,6 @@ precision=14
     <ns1:test xmlns:ns1="http://testuri.org"; />
   </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
---GZIP_POST--
-1
 --FILE--
 <?php
 function test() {
diff --git a/ext/soap/tests/server020.phpt b/ext/soap/tests/server020.phpt
index 1bd5893..b14978f 100644
--- a/ext/soap/tests/server020.phpt
+++ b/ext/soap/tests/server020.phpt
@@ -8,7 +8,7 @@ SOAP Server 20: compressed request (deflate)
 ?>
 --INI--
 precision=14
---POST--
+--DEFLATE_POST--
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <SOAP-ENV:Envelope
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
@@ -20,8 +20,6 @@ precision=14
     <ns1:test xmlns:ns1="http://testuri.org"; />
   </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
---DEFLATE_POST--
-1
 --FILE--
 <?php
 function test() {
diff --git a/run-tests.php b/run-tests.php
index cc193e5..1fe0deb 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1315,7 +1315,7 @@ TEST $file
        $tested = trim($section_text['TEST']);
 
        /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
-       if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
+       if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['GZIP_POST']) || !empty($section_text['DEFLATE_POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
                if (isset($php_cgi)) {
                        $old_php = $php;
                        $php = $php_cgi . ' -C ';
@@ -1700,15 +1700,6 @@ TEST $file
        } else if (array_key_exists('POST', $section_text) && 
!empty($section_text['POST'])) {
 
                $post = trim($section_text['POST']);
-
-               if (array_key_exists('GZIP_POST', $section_text) && 
function_exists('gzencode')) {
-                       $post = gzencode($post, 9, FORCE_GZIP);
-                       $env['HTTP_CONTENT_ENCODING'] = 'gzip';
-               } else if (array_key_exists('DEFLATE_POST', $section_text) && 
function_exists('gzcompress')) {
-                       $post = gzcompress($post, 9);
-                       $env['HTTP_CONTENT_ENCODING'] = 'deflate';
-               }
-
                save_text($tmp_post, $post);
                $content_length = strlen($post);
 
@@ -1718,6 +1709,35 @@ TEST $file
 
                $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 
< \"$tmp_post\"";
 
+    } else if (array_key_exists('GZIP_POST', $section_text) && 
!empty($section_text['GZIP_POST'])) {
+
+        $post = trim($section_text['GZIP_POST']);
+        $post = gzencode($post, 9, FORCE_GZIP);
+        $env['HTTP_CONTENT_ENCODING'] = 'gzip';
+
+        save_text($tmp_post, $post);
+        $content_length = strlen($post);
+
+        $env['REQUEST_METHOD'] = 'POST';
+        $env['CONTENT_TYPE']   = 'application/x-www-form-urlencoded';
+        $env['CONTENT_LENGTH'] = $content_length;
+
+        $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < 
\"$tmp_post\"";
+
+    } else if (array_key_exists('DEFLATE_POST', $section_text) && 
!empty($section_text['DEFLATE_POST'])) {
+        $post = trim($section_text['DEFLATE_POST']);
+        $post = gzcompress($post, 9);
+        $env['HTTP_CONTENT_ENCODING'] = 'deflate';
+        save_text($tmp_post, $post);
+        $content_length = strlen($post);
+
+        $env['REQUEST_METHOD'] = 'POST';
+        $env['CONTENT_TYPE']   = 'application/x-www-form-urlencoded';
+        $env['CONTENT_LENGTH'] = $content_length;
+
+        $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < 
\"$tmp_post\"";
+
+
        } else {
 
                $env['REQUEST_METHOD'] = 'GET';


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to