https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412009-08-30T10:35:32Zlighty labsLighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=63362009-08-30T10:35:32Zartik
<ul></ul><p>After some checks I had found same issue with HTTP Proxy module -- the disconnect on client side is not reported to the server and may cause dangling connections on the server side.</p>
<p>So this is issue for proxy servers as well.</p> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=63372009-08-30T12:28:14Zartik
<ul></ul><p>Simplest reproduction with mod_proxy.</p>
<p>Lighttpd configuration:<br /><pre>
server.modules = ("mod_proxy")
server.document-root = "./"
# mimetype mapping
mimetype.assign = (
".gif" => "image/gif",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".xml" => "text/xml",
# default mime type
"" => "application/octet-stream",
)
server.port = 8080
server.bind = "0.0.0.0"
proxy.server = ( "/hello" => ((
"host" => "127.0.0.1",
"port" => 8001
)))
</pre></p>
<p>Test no 1:</p>
<p>Run "dummy web server"</p>
<pre>
nc -l -p 8001
</pre>
<p>Run client</p>
<pre>
wget http://localhost:8001/hello
</pre>
<p>And hit Ctrl+C.</p>
<p>Observe, the dummy web server, prints headers and exits when wget is stopped.</p>
<p>Now start lighttpd with above configuration.</p>
<pre>
/usr/sbin/lighttpd -D -f light.conf
</pre>
<pre>
nc -l -p 8001
</pre>
<p>And now run wget via proxy:</p>
<pre>
wget http://localhost:8080/hello
</pre>
<p>Then press Ctrl+C</p>
<p>Observe:</p>
<p>nc prints headers but when wget is stopped it does not exits -- it is not aware that client has gone.</p> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=68802010-04-13T15:51:07Zflynn
<ul><li><strong>File</strong> <a href="/attachments/1124">lighttpd-1.4.26-bug2058.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1124/lighttpd-1.4.26-bug2058.patch">lighttpd-1.4.26-bug2058.patch</a> added</li></ul><p>The problem is, that lighttpd does not add an event on the input connection, after the request ist parsed. The only event that could happen is closing the socket, which should reset the whole connection (which closes the socket to scgi or fcgi processes too).</p>
<p>Otherwise only the write timeout detects this situation, usually after 6 minutes ( server.max-write-idle = 360 ).</p>
<p>The attached patch fixes this, but I'M not sure about side effects, so somebody who knows the state machine better should have a look ...</p> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=68812010-04-13T16:24:26Zstbuehler
<ul><li><strong>Missing in 1.5.x</strong> set to <i>No</i></li></ul><p>There is a feature called "pipelining" - which means browser can send the next request before the previous was finished.<br />So there can be normal read events too.</p>
<p>You could try writing some "keep-alive" data to check whether the connection is still active.</p> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=74922011-06-12T12:13:06Znitrox
<ul><li><strong>Target version</strong> changed from <i>1.4.x</i> to <i>1.4.29</i></li></ul> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=74942011-06-12T12:18:02Zstbuehler
<ul><li><strong>Category</strong> changed from <i>mod_fastcgi</i> to <i>core</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Wontfix</i></li><li><strong>Priority</strong> changed from <i>High</i> to <i>Normal</i></li><li><strong>Target version</strong> deleted (<del><i>1.4.29</i></del>)</li></ul><p>I'm sorry, but i don't think we will fix this in 1.x; changing the connection state machine is not easy, and i fear we will get too many bugs when we try to fix this.</p>
<p>I want to fix this in 2.0 (but right now it has the same problem).</p> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=93372016-04-11T07:26:05Zgstrauss
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-5 priority-high3 closed" href="/issues/399">Bug #399</a>: FastCGI performance on high load</i> added</li></ul> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=93392016-04-11T07:27:07Zgstrauss
<ul><li><strong>Status</strong> changed from <i>Wontfix</i> to <i>Patch Pending</i></li><li><strong>Target version</strong> set to <i>1.4.40</i></li></ul><p>proposed patch is part of <a class="external" href="https://github.com/lighttpd/lighttpd1.4/pull/53">https://github.com/lighttpd/lighttpd1.4/pull/53</a></p> Lighttpd - Bug #2058: Closed connection by peer is not reported to fastcgi/scgi servicehttps://redmine.lighttpd.net/issues/2058?journal_id=94652016-04-25T06:47:00Zgstrauss
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Fixed</i></li></ul>