diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-09-19 11:56:11 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-09-19 11:56:11 +0000 |
commit | 6af56900ac77d083b8c3abc76bd808e6718412ee (patch) | |
tree | c1deef021e181355c5a4ca6689f2c26ce6b7ad06 /src | |
parent | 7a546ad529bc715e345141261097737a986af03c (diff) |
Michael Haardt's randomized retry stuff, using the new letter "H".
Diffstat (limited to 'src')
-rw-r--r-- | src/ACKNOWLEDGMENTS | 5 | ||||
-rw-r--r-- | src/src/readconf.c | 5 | ||||
-rw-r--r-- | src/src/retry.c | 17 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/ACKNOWLEDGMENTS b/src/ACKNOWLEDGMENTS index 238b52d2a..9b60b6f30 100644 --- a/src/ACKNOWLEDGMENTS +++ b/src/ACKNOWLEDGMENTS @@ -1,4 +1,4 @@ -$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.34 2005/09/12 13:50:03 ph10 Exp $ +$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.35 2005/09/19 11:56:11 ph10 Exp $ EXIM ACKNOWLEDGEMENTS @@ -20,7 +20,7 @@ relatively small patches. Philip Hazel Lists created: 20 November 2002 -Last updated: 12 September 2005 +Last updated: 19 September 2005 THE OLD LIST @@ -146,6 +146,7 @@ Michael Haardt Tidies to make the code stricter continued maintenance of same Patch for faster sort algorithm in queue.c Patch for LDAP timeout handling + ... and several more Thomas Hager Patch for saslauthd crash bug Richard Hall Fix for file descriptor leak in redirection Steve Haslam Lots of stuff, including diff --git a/src/src/readconf.c b/src/src/readconf.c index 220438ada..3ceece489 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/readconf.c,v 1.12 2005/08/08 10:48:27 ph10 Exp $ */ +/* $Cambridge: exim/src/src/readconf.c,v 1.13 2005/09/19 11:56:11 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -3554,6 +3554,7 @@ while ((p = get_config_line()) != NULL) break; case 'G': /* Geometrically increasing intervals */ + case 'H': /* Ditto, but with randomness */ rule->p1 = retry_arg(&p, 0); rule->p2 = retry_arg(&p, 1); break; @@ -3564,7 +3565,7 @@ while ((p = get_config_line()) != NULL) } if (rule->timeout <= 0 || rule->p1 <= 0 || - (rule->rule == 'G' && rule->p2 < 1000)) + (rule->rule != 'F' && rule->p2 < 1000)) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "bad parameters for retry rule"); diff --git a/src/src/retry.c b/src/src/retry.c index 2e743a793..5126e5344 100644 --- a/src/src/retry.c +++ b/src/src/retry.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/retry.c,v 1.3 2005/06/29 14:17:01 ph10 Exp $ */ +/* $Cambridge: exim/src/src/retry.c,v 1.4 2005/09/19 11:56:11 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -739,15 +739,24 @@ for (i = 0; i < 3; i++) if (rule == NULL) next_try = now; else { if (rule->rule == 'F') next_try = now + rule->p1; - else /* assume rule = 'G' */ + else /* rule = 'G' or 'H' */ { int last_predicted_gap = retry_record->next_try - retry_record->last_try; int last_actual_gap = now - retry_record->last_try; int lastgap = (last_predicted_gap < last_actual_gap)? last_predicted_gap : last_actual_gap; - next_try = now + ((lastgap < rule->p1)? rule->p1 : - (lastgap * rule->p2)/1000); + int next_gap = (lastgap * rule->p2)/1000; + if (rule->rule == 'G') + { + next_try = now + ((lastgap < rule->p1)? rule->p1 : next_gap); + } + else /* The 'H' rule */ + { + next_try = now + rule->p1; + if (next_gap > rule->p1) + next_try += random_number(next_gap - rule->p1); + } } } |