From d7497ed79fdf74d7cd4cc77ab44c6975c45f1b8e Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 21 May 2013 01:49:54 +0000 Subject: [PATCH] - ensure callers of parse_client_queued() are aware of FLUSH_BUFFER --- src/s_bsd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/s_bsd.c b/src/s_bsd.c index bd74b9610..2908ad5cf 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -1372,7 +1372,7 @@ void proceed_normal_client_handshake(aClient *acptr, struct hostent *he) ** after we're done reading crap. ** -- nenolod */ -static void parse_client_queued(aClient *cptr) +static int parse_client_queued(aClient *cptr) { int dolen = 0; int allow_read; @@ -1386,10 +1386,10 @@ static void parse_client_queued(aClient *cptr) dolen = dbuf_getmsg(&cptr->recvQ, buf); if (dolen == 0) - return; + return 0; if (dopacket(cptr, buf, dolen) == FLUSH_BUFFER) - return; + return FLUSH_BUFFER; } } @@ -1467,7 +1467,8 @@ void read_packet(int fd, int revents, void *data) /* parse some of what we have (inducing fakelag, etc) */ if (!(DoingDNS(cptr) || DoingAuth(cptr))) - parse_client_queued(cptr); + if (parse_client_queued(cptr) == FLUSH_BUFFER) + return; /* excess flood check */ if (IsPerson(cptr) && DBufLength(&cptr->recvQ) > get_recvq(cptr))