From: Tony Finch Date: Thu, 15 Sep 2005 09:15:26 +0000 (+0000) Subject: Fix the ratelimit support in exim_fixdb. Patch provided by X-Git-Tag: exim-4_53~15 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/2e88a017b6c7a845bc223b2b883e10828407c00c Fix the ratelimit support in exim_fixdb. Patch provided by Brian Candler . --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 523caa763..8bf589aa5 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.231 2005/09/13 18:06:30 fanf2 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.232 2005/09/15 09:15:26 fanf2 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -193,6 +193,9 @@ TF/02 Added util/ratelimit.pl TF/03 Minor fix to the ratelimit code to improve its behaviour in case the clock is set back in time. +TF/04 Fix the ratelimit support in exim_fixdb. Patch provided by Brian + Candler . + Exim version 4.52 ----------------- diff --git a/src/src/exim_dbutil.c b/src/src/exim_dbutil.c index a30c695b7..4bd03601f 100644 --- a/src/src/exim_dbutil.c +++ b/src/src/exim_dbutil.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.7 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.8 2005/09/15 09:15:26 fanf2 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -767,8 +767,8 @@ for(;;) /* If the buffer contains just one digit, or just consists of "d", use the previous name for an update. */ - if ((isdigit((uschar)buffer[0]) && !isdigit((uschar)buffer[1])) || - Ustrcmp(buffer, "d") == 0) + if ((isdigit((uschar)buffer[0]) && (buffer[1] == ' ' || buffer[1] == '\0') + || Ustrcmp(buffer, "d") == 0) { if (name[0] == 0) { @@ -894,7 +894,8 @@ for(;;) break; case type_ratelimit: - ratelimit = (dbdata_ratelimit *)value; + ratelimit = (dbdata_ratelimit *)record; + length = sizeof(dbdata_ratelimit); switch(fieldno) { case 0: @@ -904,6 +905,7 @@ for(;;) case 1: ratelimit->time_usec = Uatoi(value); + break; case 2: ratelimit->rate = Ustrtod(value, NULL); @@ -1014,7 +1016,7 @@ for(;;) break; case type_ratelimit: - ratelimit = (dbdata_ratelimit *)value; + ratelimit = (dbdata_ratelimit *)record; printf("0 time stamp: %s\n", print_time(ratelimit->time_stamp)); printf("1 fract. time: .%06d\n", ratelimit->time_usec); printf("2 sender rate: % .3f\n", ratelimit->rate);