PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for sapi/cli/tests/bug70470.phpt ('Bug #70470 (Built-in server truncates headers spanning over TCP packets)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start("var_dump(getAllheaders());");
4:
5:
$fp fsockopen(PHP_CLI_SERVER_HOSTNAMEPHP_CLI_SERVER_PORT$errno$errmsg0.5);
6:
7: if (!
$fp) {
8:     die(
"connect failed: " $errmsg);
9: }
10:
11:
fwrite($fp"GET / HTTP/1.1\r\n");
12:
fwrite($fp"Host: " PHP_CLI_SERVER_HOSTNAME "\r\n");
13:
fwrite($fp"Content");
14:
fflush($fp);
15:
usleep(200000);
16:
fwrite($fp"-Type: text/html; charset=UTF-8\r\n");
17:
fwrite($fp"Connection: clo");
18:
fflush($fp);
19:
usleep(200000);
20:
fwrite($fp"se\r\n\r\n");
21: while (!
feof($fp)) {
22:     echo 
fgets($fp);
23: }
24:
fclose($fp);
25:
?>
26:

Expected

HTTP/1.1 200 OK
%a
array(3) {
  ["Host"]=>
  string(9) "localhost"
  ["Content-Type"]=>
  string(24) "text/html; charset=UTF-8"
  ["Connection"]=>
  string(5) "close"
}

Output

Unable to connect to server

Diff

001- HTTP/1.1 200 OK
003- array(3) {
004-   ["Host"]=>
005-   string(9) "localhost"
006-   ["Content-Type"]=>
007-   string(24) "text/html; charset=UTF-8"
008-   ["Connection"]=>
009-   string(5) "close"
010- }

 

Generated at Sun, 12 Nov 2017 21:17:35 +0000 (8 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.