]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Force delivery on a SIGALRM.
authorPeter Pentchev <roam@ringlet.net>
Sat, 19 Jun 2010 11:09:45 +0000 (11:09 +0000)
committerPeter Pentchev <roam@ringlet.net>
Sat, 19 Jun 2010 11:09:45 +0000 (11:09 +0000)
changelog
patches/31-sigalrm-backoff.patch [new file with mode: 0644]
patches/series

index d15cb0d195d392cc9c2fa3f95c75d8faba886e65..31895d57ed65f50195c7e685d6493ffc8319789e 100644 (file)
--- a/changelog
+++ b/changelog
@@ -44,6 +44,7 @@ dma (0.0.2010.06.17-1) UNRELEASED; urgency=low
     spool files to the new queue format (M* and Q* files for each message)
   * Add a dma-migrate invocation to dma.cron.d
   * Shorten the Vcs-Browser URL.
+  * Add the 31-sigalrm-backoff patch to force a delivery attempt on SIGALRM.
 
  -- Peter Pentchev <roam@ringlet.net>  Wed, 02 Jun 2010 14:10:05 +0300
 
diff --git a/patches/31-sigalrm-backoff.patch b/patches/31-sigalrm-backoff.patch
new file mode 100644 (file)
index 0000000..1a938a2
--- /dev/null
@@ -0,0 +1,35 @@
+Description: Allow a SIGALRM to force a delivery attempt.
+ I'll forward this patch as soon as I catch up with the dma upstream.
+Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/
+Forwarded: no
+Author: Peter Pentchev <roam@ringlet.net>
+Last-Update: 2010-06-19
+
+--- a/dma.c
++++ b/dma.c
+@@ -267,6 +267,12 @@
+ }
+ static void
++sig_alarm(int signo)
++{
++      (void)signo;    /* so that gcc doesn't complain */
++}
++
++static void
+ deliver(struct qitem *it)
+ {
+       int error;
+@@ -301,7 +307,12 @@
+                                MAX_TIMEOUT);
+                       goto bounce;
+               }
++              if (signal(SIGALRM, sig_alarm) == SIG_ERR)
++                      syslog(LOG_WARNING,
++                              "Could not set an alarm handler, the backoff "
++                              "delay cannot be interrupted");
+               sleep(backoff);
++              signal(SIGALRM, SIG_DFL);
+               backoff *= 2;
+               if (backoff > MAX_RETRY)
+                       backoff = MAX_RETRY;
index ed3011c8facf69ed16927c7c924da5876fd9e157..b7e12dedcef4396f8405824ddf584de5a16d287a 100644 (file)
@@ -13,3 +13,4 @@
 28-valid-recipient.patch
 29-double-free.patch
 30-ldflags.patch
+31-sigalrm-backoff.patch