Bug #73037 [Asn->Csd]: SoapServer reports Bad Request when gzipped

From: Date: Fri, 23 Sep 2016 14:08:30 +0000
Subject: Bug #73037 [Asn->Csd]: SoapServer reports Bad Request when gzipped
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204203@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73037&edit=1

 ID:                 73037
 Updated by:         ab@php.net
 Reported by:        maggus dot staab at googlemail dot com
 Summary:            SoapServer reports Bad Request when gzipped
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            SOAP related
 Operating System:   Ubuntu14LTS
 PHP Version:        5.6.25
 Assigned To:        ab
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=410c68788ae4826807e8ced3f4a02e676142b22a
Log: Fixed bug #73037 SoapServer reports Bad Request when gzipped


Previous Comments:
------------------------------------------------------------------------
[2016-09-19 09:01:43] ab@php.net

Yeah, you'd need to compile.

Thanks.

------------------------------------------------------------------------
[2016-09-19 07:49:02] maggus dot staab at googlemail dot com

Thx anatol for your patch!

I am not sure what the easiest way is to get a custom php7 build running with this patch included.

Do I have to build/make/compile it on my machine?

------------------------------------------------------------------------
[2016-09-16 13:56:46] ab@php.net

Markus, could you check the attached patch please? Besides your actual repro case, with the data
size < 8k, > 16k and the rest of your app.

Thanks.

------------------------------------------------------------------------
[2016-09-16 13:52:51] ab@php.net

The following patch has been added/updated:

Patch Name: bug73037.try.2.patch
Revision:   1474033971
URL:        https://bugs.php.net/patch-display.php?bug=73037&patch=bug73037.try.2.patch&revision=1474033971

------------------------------------------------------------------------
[2016-09-15 15:42:03] ab@php.net

I repro the case with gzip compression. But from what i could debug, it looks rather like an issue
with the exact case, not with the streams. The compressed data arrives, but the wrapping stream
doesn't eat all the uncompressed buffer. Right now it looks like an issue with XML parser in
conjunction with streams. 

The internal stream buffer is 8192 bytes, any data smaller than that seems to come through. Also, a
simple snippet without XML parser works, too. Like

$fd = fopen("php://input", "rb");
stream_filter_append($fd, 'zlib.inflate', STREAM_FILTER_READ, array('window'
=> 0x2f));

$in = "";
while (!feof($fd)) {
        $in .= fread($fd, 1024);
}

fclose($fd);

I was able to track this down to PHP 5.5 already. Digging further on this.

Bob, i currently don't see, how the other snippet is connected to this. Works in both 5 and 7
on my side. Maybe it's also about buffered enclosed stream. Didn't try anything else, but
google seems to deliver the whole page, though always different size.

Thanks.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=73037


--
Edit this bug report at https://bugs.php.net/bug.php?id=73037&edit=1


Thread (21 messages)

« previous php.bugs (#204203) next »