]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4-20070222
authorWietse Venema <wietse@porcupine.org>
Thu, 22 Feb 2007 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:32:58 +0000 (06:32 +0000)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/master/multi_server.c
postfix/src/master/single_server.c
postfix/src/master/trigger_server.c
postfix/src/util/attr_scan0.c
postfix/src/util/attr_scan64.c
postfix/src/util/attr_scan_plain.c

index cd536e6ab6fc106d552e7993c47d8ff3b8afe6f8..7df5b84bbc0d15cc9a519d5a2df8e932f32019ba 100644 (file)
@@ -13267,6 +13267,25 @@ Apologies for any names omitted.
        src/smtpd/smtpd.c, src/tls/tls.h, src/tls/tls_client.c,
        src/tls/tls_misc.c and src/tls/tls_server.c.
 
+20070222
+
+       Workaround: delayed "postfix reload" with ancient FreeBSD4
+       kqueue implementations, causing the first external or
+       internal clients after "postfix reload" to experience a
+       quick disconnect.  Apparently, these kqueue implementations
+       do not deliver a read notification when the master closes
+       the per-service shared master/child status pipe (even when
+       there is only one child; note that the master keeps a handle
+       to both ends of each status pipe).  A child process remains
+       ignorant that the status pipe was closed until the arrival
+       of the next client request, and then terminates.  The
+       workaround is to ignore master status write errors before
+       handling a service request.  Files: master/*_server.c.
+
+       Cleanup: fix race condition that caused unnecessary "premature
+       end-of-input" warning messages when "postfix reload" was
+       issued on a busy mail server. Files: util/attr_scan*c.
+
 Wish list:
 
        Update message content length when adding/removing headers.
index 553171c02c7ccccbb2ce0120e689b7a7aedf1ecc..940efae0785d47a42eecadc06340106ab71349ff 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20070221"
+#define MAIL_RELEASE_DATE      "20070222"
 #define MAIL_VERSION_NUMBER    "2.4"
 
 #ifdef SNAPSHOT
index 77d024e39688caf1630762396bc819b99c8215a6..06f58c06f461926f488af83adcfcda92f8d2b9f7 100644 (file)
@@ -302,11 +302,13 @@ static void multi_server_execute(int unused_event, char *context)
        msg_fatal("select unlock: %m");
 
     /*
-     * Do not bother the application when the client disconnected.
+     * Do not bother the application when the client disconnected. Don't drop
+     * the already accepted client request after "postfix reload"; that would
+     * be rude.
      */
     if (peekfd(vstream_fileno(stream)) > 0) {
        if (master_notify(var_pid, multi_server_generation, MASTER_STAT_TAKEN) < 0)
-           multi_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
+            /* void */ ;
        multi_server_service(stream, multi_server_name, multi_server_argv);
        if (master_notify(var_pid, multi_server_generation, MASTER_STAT_AVAIL) < 0)
            multi_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
index 82fec73d11c481f7dbebb85435afeda43248ae0f..62c366f04b89c031f94e904bb0172b2da1234cc0 100644 (file)
@@ -238,7 +238,8 @@ static void single_server_wakeup(int fd)
      * If the accept() succeeds, be sure to disable non-blocking I/O, because
      * the application is supposed to be single-threaded. Notice the master
      * of our (un)availability to service connection requests. Commit suicide
-     * when the master process disconnected from us.
+     * when the master process disconnected from us. Don't drop the already
+     * accepted client request after "postfix reload"; that would be rude.
      */
     if (msg_verbose)
        msg_info("connection established");
@@ -250,7 +251,7 @@ static void single_server_wakeup(int fd)
     myfree(tmp);
     timed_ipc_setup(stream);
     if (master_notify(var_pid, single_server_generation, MASTER_STAT_TAKEN) < 0)
-       single_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
+        /* void */ ;
     if (single_server_in_flow_delay && mail_flow_get(1) < 0)
        doze(var_in_flow_delay * 1000000);
     single_server_service(stream, single_server_name, single_server_argv);
index bdf042d615fa34ca11313cca4cf9b7c373560a66..77c044f3d9c2be6f86ca07c8a2170d2d9d1175cb 100644 (file)
@@ -242,10 +242,12 @@ static void trigger_server_wakeup(int fd)
     int     len;
 
     /*
-     * Commit suicide when the master process disconnected from us.
+     * Commit suicide when the master process disconnected from us. Don't
+     * drop the already accepted client request after "postfix reload"; that
+     * would be rude.
      */
     if (master_notify(var_pid, trigger_server_generation, MASTER_STAT_TAKEN) < 0)
-       trigger_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
+        /* void */ ;
     if (trigger_server_in_flow_delay && mail_flow_get(1) < 0)
        doze(var_in_flow_delay * 1000000);
     if ((len = read(fd, buf, sizeof(buf))) >= 0)
index 8297e7a18683b4f573334f0de151c9993ed0f17f..379dce7edda280af36c4776d96c78dcfe839ddfc 100644 (file)
@@ -266,6 +266,13 @@ int     attr_vscan0(VSTREAM *fp, int flags, va_list ap)
     if (flags & ~ATTR_FLAG_ALL)
        msg_panic("%s: bad flags: 0x%x", myname, flags);
 
+    /*
+     * EOF check.
+     */
+    if ((ch = VSTREAM_GETC(fp)) == VSTREAM_EOF)
+       return (0);
+    vstream_ungetc(fp, ch);
+
     /*
      * Initialize.
      */
index d148e6d8ffa34521a43ca67ba90eed586e6c02aa..860f8b371ef914dd6cfca9d7d32056b30a11e3dc 100644 (file)
@@ -269,6 +269,13 @@ int     attr_vscan64(VSTREAM *fp, int flags, va_list ap)
     if (flags & ~ATTR_FLAG_ALL)
        msg_panic("%s: bad flags: 0x%x", myname, flags);
 
+    /*
+     * EOF check.
+     */
+    if ((ch = VSTREAM_GETC(fp)) == VSTREAM_EOF)
+       return (0);
+    vstream_ungetc(fp, ch);
+
     /*
      * Initialize.
      */
index 2d8f1a2881bf3c8b52dddc0ff21d2aa469b042b6..619bfae64ac872d7ccba51428d4eb555cab8a507 100644 (file)
@@ -282,6 +282,13 @@ int     attr_vscan_plain(VSTREAM *fp, int flags, va_list ap)
     if (flags & ~ATTR_FLAG_ALL)
        msg_panic("%s: bad flags: 0x%x", myname, flags);
 
+    /*
+     * EOF check.
+     */
+    if ((ch = VSTREAM_GETC(fp)) == VSTREAM_EOF)
+       return (0);
+    vstream_ungetc(fp, ch);
+
     /*
      * Initialize.
      */