From: Simon Schubert <2@0x2c.org> Date: Thu, 28 Oct 2010 21:51:45 +0000 (+0200) Subject: drop 35-delivery-retry.patch: better version aready committed X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=345d97b5e62af88e33ee08b093d3fc2cab2cb15f;p=people%2Fms%2Fdma.git drop 35-delivery-retry.patch: better version aready committed --- diff --git a/debian/patches/35-delivery-retry.patch b/debian/patches/35-delivery-retry.patch deleted file mode 100644 index 1fbb459..0000000 --- a/debian/patches/35-delivery-retry.patch +++ /dev/null @@ -1,44 +0,0 @@ -Description: Randomize the retry timeouts a bit. -Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ -Forwarded: http://bugs.launchpad.net/dma/+bug/599542 -Author: Peter Pentchev -Last-Update: 2010-06-28 - ---- a/dma.c -+++ b/dma.c -@@ -276,7 +276,7 @@ - deliver(struct qitem *it) - { - int error; -- unsigned int backoff = MIN_RETRY; -+ unsigned int backoff = it->remote? MIN_RETRY: MIN_RETRY_LOCAL; - const char *errmsg = "unknown bounce reason"; - struct timeval now; - struct stat st; -@@ -313,7 +313,13 @@ - "delay cannot be interrupted"); - sleep(backoff); - signal(SIGALRM, SIG_DFL); -- backoff *= 2; -+ backoff = backoff * 2 + ( -+#ifdef HAVE_RANDOM -+ random() -+#else -+ rand() -+#endif -+ % RETRY_JITTER); - if (backoff > MAX_RETRY) - backoff = MAX_RETRY; - goto retry; ---- a/dma.h -+++ b/dma.h -@@ -48,7 +48,9 @@ - - #define BUF_SIZE 2048 - #define MIN_RETRY 300 /* 5 minutes */ -+#define MIN_RETRY_LOCAL 30 /* 30 seconds */ - #define MAX_RETRY (3*60*60) /* retry at least every 3 hours */ -+#define RETRY_JITTER 10 - #define MAX_TIMEOUT (5*24*60*60) /* give up after 5 days */ - #ifndef PATH_MAX - #define PATH_MAX 1024 /* Max path len */