diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2004-03-17 14:42:21 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2004-03-17 14:42:21 +0000 |
commit | 9644ef019dd4f628919da5b1ebabbd88956371d7 (patch) | |
tree | f18aa76b4324bcfef1ce3a4beb57259f8d28ac5c /libexec/spamd/spamd.c | |
parent | 256b09ea3d17344e4f5638ad469b5355db3ffc43 (diff) |
fix problem with counter and logging spotted by danh, where logging
would get messed up when the blacklist limit was hit.
tested by danh@ and me
ok cedric@
Diffstat (limited to 'libexec/spamd/spamd.c')
-rw-r--r-- | libexec/spamd/spamd.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c index 3274bc38327..5f450a4a833 100644 --- a/libexec/spamd/spamd.c +++ b/libexec/spamd/spamd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spamd.c,v 1.63 2004/03/16 09:19:25 jmc Exp $ */ +/* $OpenBSD: spamd.c,v 1.64 2004/03/17 14:42:20 beck Exp $ */ /* * Copyright (c) 2002 Theo de Raadt. All rights reserved. @@ -550,16 +550,6 @@ initcon(struct con *cp, int fd, struct sockaddr_in *sin) cp->ia = (void *) &cp->sin.sin_addr; cp->blacklists = sdl_lookup(blacklists, cp->af, cp->ia); cp->stutter = (greylist && cp->blacklists == NULL) ? 0 : stutter; - if (cp->blacklists != NULL) { - blackcount++; - if (greylist && blackcount > maxblack) { - closecon(cp); /* close and free */ - return; - } - cp->lists = strdup(loglists(cp)); - } - else - cp->lists = NULL; strlcpy(cp->addr, inet_ntoa(sin->sin_addr), sizeof(cp->addr)); tmp = strdup(ctime(&t)); if (tmp == NULL) @@ -575,6 +565,16 @@ initcon(struct con *cp, int fd, struct sockaddr_in *sin) cp->s = t; strlcpy(cp->rend, "\n", sizeof cp->rend); clients++; + if (cp->blacklists != NULL) { + blackcount++; + if (greylist && blackcount > maxblack) { + closecon(cp); /* close and free */ + return; + } + cp->lists = strdup(loglists(cp)); + } + else + cp->lists = NULL; } void |