Bug #60471 [Asn]: Random "Invalid request (unexpected EOF)" using a router script

From: Date: Wed, 24 Oct 2012 07:39:35 +0000
Subject: Bug #60471 [Asn]: Random "Invalid request (unexpected EOF)" using a router script
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-174262@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60471&edit=1

 ID:                 60471
 Updated by:         laruence@php.net
 Reported by:        lolautruche at gmail dot com
 Summary:            Random "Invalid request (unexpected EOF)" using a
                     router script
 Status:             Assigned
 Type:               Bug
 Package:            Built-in web server
 Operating System:   Mac OS X 10.7.2 (Lion)
 PHP Version:        5.4.0RC2
 Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

Hey, actually, this warnnig message is no harm.


Previous Comments:
------------------------------------------------------------------------
[2012-10-24 07:36:36] pascal dot chevrel at free dot fr

Just in case it matters, I am seeing the same bug on Linux with Firefox (both Firefox releases and
Nightly builds)

------------------------------------------------------------------------
[2012-02-25 15:15:24] michal dot pipa dot xsolve at gmail dot com

I've attached a patch that disables "Unexpected EOF" error message from built-in
server.

------------------------------------------------------------------------
[2012-02-23 18:45:53] michal dot pipa dot xsolve at gmail dot com

I've noticed these messages and did some network traffic analysis.

I've tested this on Ubuntu and Chromium. What I've found is that Chromium has feature
called "Predict network actions to improve page load performance" and it's enabled by
default. It works this way, that if HTML page has links to some resources, than Chromium opens about
10 TCP connections in advance. And then if browser has less than 10 resources to fetch, unused
connections times out after 10 seconds. And this (empty payload) causes PHP server to display
"Invalid request (unexpected EOF)" message.

See: http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c?revision=322966&view=markup#l1591

When you disable this Chromium's feature it doesn't open TCP connections in advance and
this error message disappears.

I'm wondering if we really need this error message (maybe it was used for some debugging
purposes).

------------------------------------------------------------------------
[2012-02-16 18:29:02] rasmus@php.net

The patch is here:

http://svn.php.net/viewvc/php/php-src/trunk/sapi/cli/php_cli_server.c?
r1=323078&r2=323077&pathrev=323078&view=patch

if someone could test it, please.

------------------------------------------------------------------------
[2012-02-16 18:24:54] rasmus@php.net

Could this simply be caused by the "Connection: closed" message instead of the 
correct "Connection: close" message the built-in server spits out? This is fixed 
in trunk but hasn't been merged to 5.4 yet.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=60471


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60471&edit=1


Thread (29 messages)

« previous php.bugs (#174262) next »