ID:               37641
 User updated by:  roguestar191 at comcast dot net
 Reported By:      roguestar191 at comcast dot net
 Status:           Open
 Bug Type:         CGI related
 Operating System: linux
 PHP Version:      5.1.4
 New Comment:

sorry that should be "when the server doesn't pad all the packets to
the size of 8"


Previous Comments:
------------------------------------------------------------------------

[2006-05-30 09:35:50] roguestar191 at comcast dot net

Description:
------------
line 624 of sapi/cgi/fastcgi.c contains:

while (recv(req->fd, buf, strlen(buf), 0) > 0) {}

with buf being an array with 8 elements.

With the server doesn't pad all packets to the size of 8 

(Which is suggested but not required by the fast-cgi spec), this causes
frequent lockups and failed requests. (Without that padding, I have no
idea about with it).

My fix was simple - change strlen(buf) (which returns 8), to 1, so it
will read any excess bytes at the end and cleanly close and continue
on, even if it's not a multiple of 8 bytes.  

Thank you for php!

Expected result:
----------------
fast-cgi padding to be read and thrown out, requests to close.

Actual result:
--------------
request tends to lock up on recv when packets arn't a multiple of 8 in
size.


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


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

Reply via email to