|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-03-31 14:48 UTC] Olaf at XCC dot TMFWeb dot NL
Description:
------------
This code sends two packets, one of 16 bytes and one of 17 bytes.
I guess this is caused by multiple calls to php_stream_write in
http_fopen_wrapper.c: php_stream_url_wrap_http_ex
Preparing the entire request in one buffer and sending it via one call should produce less packets (and be faster).
Reproduce code:
---------------
<?php
echo strlen(file_get_contents("http://php.net/"));
?>
Expected result:
----------------
One packet of 33 bytes.
Actual result:
--------------
Two packets.
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
Problem still exists. tcpdump shows during execution test example that 'GET ...' and 'Host ...' are sent by multiple packets: --------- 000110 IP (tos 0x0, ttl 64, id 62602, offset 0, flags [DF], proto 6, length: 68) x.x.x.x.42720 > 69.147.83.197.80: P [tcp sum ok] 1:17(16) ack 1 win 1460 <nop,nop,timestamp 339227911 3473916863> E..D..@.@... . FE.S....P.....,.D........... .85.....GET / HTTP/1.0 101682 IP (tos 0x0, ttl 57, id 8438, offset 0, flags [DF], proto 6, length: 52) 69.147.83.197.80 > x.x.x.x.42720: . [tcp sum ok] 1:1(0) ack 17 win 33296 <nop,nop,timestamp 3473916965 339227911> E..4 .@.9.sTE.S. . F.P...,.D........,z..... ...%.85. 000024 IP (tos 0x0, ttl 64, id 62603, offset 0, flags [DF], proto 6, length: 69) x.x.x.x.42720 > 69.147.83.197.80: P [tcp sum ok] 17:34(17) ack 1 win 1460 <nop,nop,timestamp 339227937 3473916965> E..E..@.@... . FE.S....P.....,.D........... .85!...%Host: php.net 013718 IP (tos 0x0, ttl 57, id 61609, offset 0, flags [DF], proto 6, length: 1500) 69.147.83.197.80 > x.x.x.x.42720: . 1: 1449(1448) ack 34 win 33304 <nop,nop,timestamp 3473916977 339227937> E.....@.9...E.S. . F.P...,.D........,_..... ...1.85!HTTP/1.1 200 OK D ate: Fri, 07 ---------