ID: 37641 Updated by: [EMAIL PROTECTED] Reported By: roguestar191 at comcast dot net -Status: Assigned +Status: Feedback Bug Type: CGI related Operating System: linux PHP Version: 5.1.4 Assigned To: dmitry New Comment:
I am not sure that the reason of problem is padding. Seems fcgi module doesn't close connection. Does it use FCGI_KEEP_CONN? What web server and fcgi module do you use? Previous Comments: ------------------------------------------------------------------------ [2006-05-30 09:37:18] roguestar191 at comcast dot net sorry that should be "when the server doesn't pad all the packets to the size of 8" ------------------------------------------------------------------------ [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