ZF-533: Server only reads the first line of the request
Description
It seems that the server only reads the first line of the request from the client, and then sends out the response. For example:
shahar.e@wintergreen tests $ telnet localhost 8888
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /testSimpleRequests.php HTTP/1.1
HTTP/1.1 200 OK
Content-type: text/html
X-powered-by: PHP/5.1.6-pl8-gentoo
SuccessConnection closed by foreign host.
I only typed the "GET" line - and when I hit enter I got the response. Normally, the server should wait for a blank line (IE two consecutive CRLFs) before it finishes reading.
This prevents sending HTTP headers (and cookies) as well as message body (IE POST data).
For comparison, this is a request for the same file (docroot is different but it's the same script) from Apache 2.0.x:
shahar.e@wintergreen tests $ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /Framework/tests/testSimpleRequests.php HTTP/1.1
Host: localhost
Connection: close
HTTP/1.1 200 OK
Date: Fri, 10 Nov 2006 21:09:01 GMT
Server: Apache
X-Powered-By: PHP/5.1.6-pl8-gentoo
Content-Length: 7
Connection: close
Content-Type: text/html
SuccessConnection closed by foreign host.
Here, I was able to type the "Host" and "Connection" headers, and then a blank line, and only then I got the response.
Comments
Posted by Mat Scales (mat) on 2006-11-11T16:02:04.000+0000
I made a change to the way this was handled just before commiting the code... looks like I messed it up!
I'll see if I can remember what I changed and put it back
Posted by Shahar Evron (shahar) on 2006-11-18T10:53:50.000+0000
In revision 1727 this problem still happens (after the ZF-547 fix)