[exim-cvs] cvs commit: exim/exim-doc/doc-txt NewStuff exim/e…

Góra strony
Delete this message
Reply to this message
Autor: Tony Finch
Data:  
Dla: exim-cvs
Temat: [exim-cvs] cvs commit: exim/exim-doc/doc-txt NewStuff exim/exim-src/src acl.c
fanf2 2005/05/25 10:58:16 BST

  Modified files:
    exim-doc/doc-txt     NewStuff 
    exim-src/src         acl.c 
  Log:
  Change the result of the ratelimit ACL condition when clients are sending
  exactly at the limit, in order to improve the behaviour of certain edge
  cases. The result was FAIL (under limit) and it's now OK (over limit).


  Revision  Changes    Path
  1.46      +2 -2      exim/exim-doc/doc-txt/NewStuff
  1.35      +9 -4      exim/exim-src/src/acl.c


  Index: NewStuff
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -u -r1.45 -r1.46
  --- NewStuff    23 May 2005 16:58:55 -0000    1.45
  +++ NewStuff    25 May 2005 09:58:16 -0000    1.46
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.45 2005/05/23 16:58:55 fanf2 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.46 2005/05/25 09:58:16 fanf2 Exp $


New Features in Exim
--------------------
@@ -132,8 +132,8 @@

           ratelimit = <m> / <p> / <options> / <key>


  -      If the average client sending rate is greater than m messages per time
  -      period p then the condition is true, otherwise it is false.
  +      If the average client sending rate is less than m messages per time
  +      period p then the condition is false, otherwise it is true.


         The parameter p is the smoothing time constant, in the form of an Exim
         time interval e.g. 8h for eight hours. A larger time constant means it


  Index: acl.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/acl.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -u -r1.34 -r1.35
  --- acl.c    23 May 2005 16:58:56 -0000    1.34
  +++ acl.c    25 May 2005 09:58:16 -0000    1.35
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/acl.c,v 1.34 2005/05/23 16:58:56 fanf2 Exp $ */
  +/* $Cambridge: exim/exim-src/src/acl.c,v 1.35 2005/05/25 09:58:16 fanf2 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -2022,8 +2022,8 @@
     {
     dbd = t->data.ptr;
     /* The following few lines duplicate some of the code below. */
  -  if (dbd->rate > limit) rc = OK;
  -    else rc = FAIL;
  +  if (dbd->rate < limit) rc = FAIL;
  +    else rc = OK;
     store_pool = old_pool;
     sender_rate = string_sprintf("%.1f", dbd->rate);
     HDEBUG(D_acl)
  @@ -2130,8 +2130,13 @@
       dbd->rate = (1 - a) / i_over_p + a * dbd->rate;
     }


-if (dbd->rate > limit) rc = OK;
- else rc = FAIL;
+/* Clients sending at the limit are considered to be over the limit. This
+matters for edge cases such the first message sent by a client (which gets
+the initial rate of 0.0) when the rate limit is zero (i.e. the client should
+be completely blocked). */
+
+if (dbd->rate < limit) rc = FAIL;
+ else rc = OK;

/* Update the state if the rate is low or if we are being strict. If we
are in leaky mode and the sender's rate is too high, we do not update