aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--fetchmail.c20
2 files changed, 20 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index fb291df8..2676763d 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,10 @@ bugs --
* Added some port patches for NEXTSTEP.
+* SIGCHLD used everywhere now, not SIGCLD (this was strictly a cosmetic bug).
+
+* Prevent occasional hangs when fetchmail was terminated by signal.
+
------------------------------------------------------------------------------
fetchmail-2.2 (Mon Dec 9 00:15:01 EST 1996):
@@ -44,7 +48,7 @@ bugs --
* Fix error in MX record handling that was causing multidrop problems.
-* Disable daemon SIGCLD handler while an MDA is running, to avoid snafus.
+* Disable daemon SIGCHLD handler while an MDA is running, to avoid snafus.
Thanks to Dave Bodenstab <imdave@synet.net> for spotting this obscure bug.
156 people on the contact list.
diff --git a/fetchmail.c b/fetchmail.c
index 3dece2be..882c7e44 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -628,13 +628,23 @@ void termhook(int sig)
{
struct query *ctl;
+ /*
+ * Sending SMTP QUIT on signal is theoretically nice, but led to a
+ * subtle bug. If fetchmail was terminated by signal while it was
+ * shipping message text, it would hang forever waiting for a
+ * command acknowledge. In theory we could disable the QUIT
+ * only outside of the message send. In practice, we don't
+ * care. All mailservers hang up on a dropped TCP/IP connection
+ * anyway.
+ */
+
if (sig != 0)
fprintf(stderr, "terminated with signal %d\n", sig);
-
- /* terminate all SMTP connections cleanly */
- for (ctl = querylist; ctl; ctl = ctl->next)
- if (ctl->lead_smtp == ctl && ctl->smtp_sockfp != (FILE *)NULL)
- SMTP_quit(ctl->smtp_sockfp);
+ else
+ /* terminate all SMTP connections cleanly */
+ for (ctl = querylist; ctl; ctl = ctl->next)
+ if (ctl->lead_smtp == ctl && ctl->smtp_sockfp != (FILE *)NULL)
+ SMTP_quit(ctl->smtp_sockfp);
if (!check_only)
write_saved_lists(querylist, idfile);