Project

General

Profile

Bug #2566

mod_fastcgi should handle "quick" responses

Added by stbuehler about 3 years ago. Updated about 1 year ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_fastcgi
Target version:
Start date:
2014-04-02
Due date:
% Done:

100%

Missing in 1.5.x:
No

Description

mod_fastcgi fails if the fastcgi application closes the connection after sending a response without waiting for the request body.

For example libfcgi closes the connection after a 2 second timeout while reading after the response is sent:

select(5, [4], NULL, NULL, {2, 0})      = 0 (Timeout)
close(4)                                = 0

Such timeout can especially occur on slow (embedded) systems when lighttpd isn't able to read the POST data fast enough from the tmpfiles, or the system is generally busy otherwise.

For unix sockets we could handle EPIPE as indication for this; we should still be able to read the response after that. On TCP sockets we probably would get ECONNRESET, and reading might not work after that.

This means that mod_fastcgi should also select for read events on the socket while it is writing the request data (and therefore waiting for write events), which the current fdevent API cannot handle.


Related issues

Related to Bug #131: FastCGI FCGI_STDOUT before FCGI_STDIN bug Fixed

Associated revisions

Revision 2f21aaa9 (diff)
Added by gstrauss about 1 year ago

handlers can read response before sending req body (fixes #131, #2566)

dynamic handlers mod_fastcgi, mod_scgi, and mod_proxy can now read
response from backend prior to finishing sending request body.

If the backend closes the connections (or shuts down socket write
end so that lighttpd read() 0 to indicate EOF), then lighttpd will
abort attempting to send request body to backend.

x-ref:
"mod_fastcgi should handle "quick" responses"
https://redmine.lighttpd.net/issues/2566
"FastCGI FCGI_STDOUT before FCGI_STDIN bug"
https://redmine.lighttpd.net/issues/131

History

#1 Updated by gstrauss about 1 year ago

  • Related to Bug #131: FastCGI FCGI_STDOUT before FCGI_STDIN bug added

#2 Updated by gstrauss about 1 year ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.40

#3 Updated by gstrauss about 1 year ago

  • Category set to mod_fastcgi

#4 Updated by gstrauss about 1 year ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom