]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mpm_event: don't reset connections after lingering close timeout
authorYann Ylavic <ylavic@apache.org>
Wed, 4 Nov 2020 00:32:50 +0000 (00:32 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 4 Nov 2020 00:32:50 +0000 (00:32 +0000)
While httpd is supposed to do lingering close for incoming data, it has no
control anyway over outgoing/pending data once they are handled by the
system.

So don't reset the connection after lingering close times out, otherwise the
system won't do its own lingering close to flush un-acked data.

The connection reset was introduced by r1802875 and backported to 2.4.28.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883097 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/event_abort_socket_no_reset.txt [new file with mode: 0644]
server/mpm/event/event.c

diff --git a/changes-entries/event_abort_socket_no_reset.txt b/changes-entries/event_abort_socket_no_reset.txt
new file mode 100644 (file)
index 0000000..d26357e
--- /dev/null
@@ -0,0 +1,3 @@
+  *) mpm_event: don't reset connections after lingering close, restoring prior
+     to 2.4.28 behaviour.  [Yann Ylavic]
+
index bcd711323cd4fcd2a1a016f07fe67d9431c5271b..dbfe65c513dc5ccad743726bedb0d233b36b8731 100644 (file)
@@ -558,21 +558,6 @@ static void abort_socket_nonblocking(apr_socket_t *csd)
 {
     apr_status_t rv;
     apr_socket_timeout_set(csd, 0);
-#if defined(SOL_SOCKET) && defined(SO_LINGER)
-    /* This socket is over now, and we don't want to block nor linger
-     * anymore, so reset it. A normal close could still linger in the
-     * system, while RST is fast, nonblocking, and what the peer will
-     * get if it sends us further data anyway.
-     */
-    {
-        apr_os_sock_t osd = -1;
-        struct linger opt;
-        opt.l_onoff = 1;
-        opt.l_linger = 0; /* zero timeout is RST */
-        apr_os_sock_get(&osd, csd);
-        setsockopt(osd, SOL_SOCKET, SO_LINGER, (void *)&opt, sizeof opt);
-    }
-#endif
     rv = apr_socket_close(csd);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, APLOGNO(00468)