File: envresponse016.phpt

package info (click to toggle)
php-pecl-http 3.2.0%2B2.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,128 kB
  • sloc: ansic: 38,356; php: 942; xml: 805; pascal: 185; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (7)
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
--TEST--
env response send failure
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php

echo "Test\n";

class closer extends php_user_filter {
	function filter ($in, $out, &$consumed, $closing) {
		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