File: envresponse016.phpt

package info (click to toggle)
php-pecl-http 4.2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,240 kB
  • sloc: ansic: 20,086; php: 682; xml: 394; pascal: 161; makefile: 3
file content (37 lines) | stat: -rw-r--r-- 718 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--TEST--
env response send failure
--SKIPIF--
<?php
include "skipif.inc";
?>
--XFAIL--
stream filters leak since 8.2
--FILE--
<?php

echo "Test\n";

class closer extends php_user_filter {
	function filter ($in, $out, &$consumed, $closing) : int {
		while ($bucket = stream_bucket_make_writeable($in)) {
			stream_bucket_append($out, $bucket);
		}
		return PSFS_ERR_FATAL;
	}
}

stream_filter_register("closer", "closer");

$r = new http\Env\Response;
$r->getBody()->append(str_repeat("a", 16*1024*4));
$s = fopen("php://temp", "w");
stream_filter_append($s, "closer");
var_dump($r->send($s));
?>
DONE
--EXPECTF--
Test

Warning: http\Env\Response::send(): Failed to send response body in %s on line %d
bool(false)
DONE