[exim-cvs] cvs commit: exim/exim-src/src acl.c

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Tony Finch
Dátum:  
Címzett: exim-cvs
Tárgy: [exim-cvs] cvs commit: exim/exim-src/src acl.c
fanf2 2005/05/31 18:07:39 BST

  Modified files:
    exim-src/src         acl.c 
  Log:
  ratelimit fix: omit the limit parameter from the database lookup
  key, so that minor configuration tweaks do not cause Exim to forget
  clients' stored rates. The smoothing period and options affect the
  meaning of the stored state, so are still included in the key.


  Revision  Changes    Path
  1.37      +8 -4      exim/exim-src/src/acl.c


  Index: acl.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/acl.c,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -u -r1.36 -r1.37
  --- acl.c    31 May 2005 10:58:18 -0000    1.36
  +++ acl.c    31 May 2005 17:07:39 -0000    1.37
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/acl.c,v 1.36 2005/05/31 10:58:18 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/acl.c,v 1.37 2005/05/31 17:07:39 fanf2 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1920,7 +1920,7 @@
   acl_ratelimit(uschar *arg, uschar **log_msgptr)
   {
   double limit, period;
  -uschar *ss, *key = arg;
  +uschar *ss, *key;
   int sep = '/';
   BOOL have_key = FALSE, leaky = FALSE, strict = FALSE;
   BOOL per_byte = FALSE, per_cmd = FALSE, per_conn = FALSE, per_mail = FALSE;
  @@ -1956,6 +1956,12 @@
     return ERROR;
     }


+/* We use the rest of the argument list following the limit as the
+lookup key, because it doesn't make sense to use the same stored data
+if the period or options are different. */
+
+key = arg;
+
/* Second is the rate measurement period and exponential smoothing time
constant. This must be strictly greater than zero, because zero leads to
run-time division errors. */
@@ -1996,9 +2002,7 @@
if (!strict) leaky = TRUE;
if (!per_byte && !per_cmd && !per_conn) per_mail = TRUE;

-/* We use the whole of the argument list as the lookup key, because it doesn't
-make sense to use the same stored data if any of the arguments are different.
-If there is no explicit key, use the sender_host_address. If there is no
+/* If there is no explicit key, use the sender_host_address. If there is no
sender_host_address (e.g. -bs or acl_not_smtp) then we simply omit it. */

if (!have_key && sender_host_address != NULL)