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: Verified
+Status: Feedback
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:
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.
Previous Comments:
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
[2016-09-12 12:17:54] maggus dot staab at googlemail dot com
I can re-produce the issue with opcache, blackfire disabled. same issue without those extensions.
------------------------------------------------------------------------
[2016-09-09 17:53:43] bwoebi@php.net
I had looked at the issue and it's not related to any extension (only zlib, soap and libxml
code is ever called).
There's something fishy when _php_stream_read() is called recursively though.
Thus simple code like:
class simple_filter extends php_user_filter {
function filter($in, $out, &$consumed, $closing) {
while ($bucket = stream_bucket_make_writeable($in)) {
$consumed += $bucket->datalen;
stream_bucket_append($out, $bucket);
}
return PSFS_PASS_ON;
}
}
stream_filter_register("simple", "simple_filter");
file_get_contents("php://filter/read=simple/resource=http://google.com");
is also failing in PHP 7. (works flawlessly with PHP 5.)
------------------------------------------------------------------------
[2016-09-08 22:56:15] ab@php.net
Thanks for the report. Is the behavior same without Opcache and Blackfire? Ideally, with anything
except soap and gzip excluded.
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