Permalink
Browse files

catch payload_len=0 from backend

some applications seem to send an empty FCGI_STDOUT payload before the
actual FCGI_END packet. catch this case and just do nothing (i.e. read
the next packet)
  • Loading branch information...
hollow committed Jun 5, 2011
1 parent c9bd8e0 commit 6ec5f625f12ee3f58b1e69852387cced582f3d8d
Showing with 3 additions and 0 deletions.
  1. +3 −0 fcgi_server.c
View
@@ -471,6 +471,9 @@ int fcgi_server_recv_stdout_stderr_record(fcgi_request_t *fr,
"FastCGI: packet received (id=%u, type=%u, payload_len=%u)",
request_id, type, payload_len);
+ if (payload_len == 0)
+ continue;
+
/* Step 3: read FCGI payload */
bytes_read = socket_recv(fr, buffer, payload_len);

0 comments on commit 6ec5f62

Please sign in to comment.