Added a long comment to acl.c about the problem of detecting a client
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Wed, 11 May 2005 09:26:55 +0000 (09:26 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Wed, 11 May 2005 09:26:55 +0000 (09:26 +0000)
going away during a "delay" wait.

src/src/acl.c

index b91d9d0414b88401fbe9fea0ebfdca773007bcae..9d4a7789f3602848c2f31ed612a11cc2e0d3bce0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/acl.c,v 1.29 2005/05/10 10:19:11 ph10 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.30 2005/05/11 09:26:55 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -2178,6 +2178,22 @@ for (; cb != NULL; cb = cb->next)
           HDEBUG(D_acl)
             debug_printf("delay skipped in -bh checking mode\n");
           }
+
+        /* It appears to be impossible to detect that a TCP/IP connection has
+        gone away without reading from it. This means that we cannot shorten
+        the delay below if the client goes away, because we cannot discover
+        that the client has closed its end of the connection. (The connection
+        is actually in a half-closed state, waiting for the server to close its
+        end.) It would be nice to be able to detect this state, so that the
+        Exim process is not held up unnecessarily. However, it seems that we
+        can't. The poll() function does not do the right thing, and in any case
+        it is not always available.
+
+        NOTE: If ever this state of affairs changes, remember that we may be
+        dealing with stdin/stdout here, in addition to TCP/IP connections.
+        Whatever is done must work in both cases. To detected the stdin/stdout
+        case, check for smtp_in or smtp_out being NULL. */
+
         else
           {
           while (delay > 0) delay = sleep(delay);