Bug #70470 [NEW]: Built-in server truncates headers spanning over TCP packets

From: Date: Thu, 10 Sep 2015 19:03:34 +0000
Subject: Bug #70470 [NEW]: Built-in server truncates headers spanning over TCP packets
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195948@lists.php.net to get a copy of this message
From: bwoebi Operating system: Irrelevant PHP version: 5.6.13 Package: Built-in web server Bug Type: Bug Bug description:Built-in server truncates headers spanning over TCP packets Description: ------------ The built-in server can truncate headers if they span over a TCP packet boundary. Internally, it uses MARK(header_value) (Sets header_value_mark to the current pointer), then upon reaching the \r\n (in the next packet then, same buffer), but the \r\n will end up being before the header_value_mark pointer, thus ending up of never reading the part before the \r\n in the second packet. Test script: --------------- Use a valid header and ensure it's send in two different TCP packets to built-in server. Begin sending a header value in one packet and finish it in another. Then dump the header value. Expected result: ---------------- Header value should be complete. Actual result: -------------- The header value is being truncated at the exact packet boundary. -- Edit bug report at https://bugs.php.net/bug.php?id=70470&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70470&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70470&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70470&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70470&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70470&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70470&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70470&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70470&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70470&r=support Expected behavior: https://bugs.php.net/fix.php?id=70470&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70470&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70470&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70470&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70470&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70470&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70470&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70470&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70470&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70470&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70470&r=mysqlcfg

« previous php.bugs (#195948) next »