--------------------- PatchSet 5023 Date: 2002/09/17 20:56:01 Author: rbcollins Branch: fixrange Tag: (none) Log: extract OS buffer emptying from connStateFree Members: src/client_side.c:1.72.2.15->1.72.2.16 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.72.2.15 retrieving revision 1.72.2.16 diff -u -r1.72.2.15 -r1.72.2.16 --- squid/src/client_side.c 17 Sep 2002 14:42:15 -0000 1.72.2.15 +++ squid/src/client_side.c 17 Sep 2002 20:56:01 -0000 1.72.2.16 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.72.2.15 2002/09/17 14:42:15 rbcollins Exp $ + * $Id: client_side.c,v 1.72.2.16 2002/09/17 20:56:01 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -139,6 +139,8 @@ static void clientPrepareLogWithRequestDetails (request_t *, AccessLogEntry *); static void clientLogRequest(clientHttpRequest *); static void httpRequestFreeResources(clientHttpRequest *); +static void connEmptyOSReadBuffers(int fd); + clientStreamNode * getTail (clientSocketContext *context) @@ -414,6 +416,16 @@ cbdataFree(context); } } + +void +connEmptyOSReadBuffers(int fd) +{ +#ifdef _SQUID_LINUX_ + /* prevent those nasty RST packets */ + char buf[SQUID_TCP_SO_RCVBUF]; + while (FD_READ_METHOD(fd, buf, SQUID_TCP_SO_RCVBUF) > 0); +#endif +} /* This is a handler normally called by comm_close() */ static void @@ -432,13 +444,7 @@ memFreeBuf(connState->in.size, connState->in.buf); pconnHistCount(0, connState->nrequests); cbdataFree(connState); -#ifdef _SQUID_LINUX_ - /* prevent those nasty RST packets */ - { - char buf[SQUID_TCP_SO_RCVBUF]; - while (FD_READ_METHOD(fd, buf, SQUID_TCP_SO_RCVBUF) > 0); - } -#endif + connEmptyOSReadBuffers(fd); } /*