--------------------- PatchSet 2306 Date: 2001/05/10 17:22:07 Author: adri Branch: newhttp Tag: (none) Log: implement COMM_EOF. This is set if we hit the EOF on a filedescriptor stream. Its only used returning from comm_read() .. Members: src/comm.c:1.1.1.3.8.7.4.3.2.5->1.1.1.3.8.7.4.3.2.6 src/defines.h:1.1.1.3.8.7.2.8.2.3->1.1.1.3.8.7.2.8.2.4 src/modules/http_upstream/http.c:1.1.2.2->1.1.2.3 Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.1.1.3.8.7.4.3.2.5 retrieving revision 1.1.1.3.8.7.4.3.2.6 diff -u -r1.1.1.3.8.7.4.3.2.5 -r1.1.1.3.8.7.4.3.2.6 --- squid/src/comm.c 7 May 2001 13:23:41 -0000 1.1.1.3.8.7.4.3.2.5 +++ squid/src/comm.c 10 May 2001 17:22:07 -0000 1.1.1.3.8.7.4.3.2.6 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.1.1.3.8.7.4.3.2.5 2001/05/07 13:23:41 rbcollins Exp $ + * $Id: comm.c,v 1.1.1.3.8.7.4.3.2.6 2001/05/10 17:22:07 adri Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1034,11 +1034,7 @@ commReadCallback(fd, retval, COMM_OK); } else if (retval == 0) { /* We got an EOF */ - /* - * I've broken out the EOF in case we have to handle it differently - * at a later date - */ - commReadCallback(fd, 0, COMM_OK); + commReadCallback(fd, 0, COMM_EOF); } else { /* Error! */ if (ignoreErrno(errno)) Index: squid/src/defines.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/defines.h,v retrieving revision 1.1.1.3.8.7.2.8.2.3 retrieving revision 1.1.1.3.8.7.2.8.2.4 diff -u -r1.1.1.3.8.7.2.8.2.3 -r1.1.1.3.8.7.2.8.2.4 --- squid/src/defines.h 7 May 2001 13:23:41 -0000 1.1.1.3.8.7.2.8.2.3 +++ squid/src/defines.h 10 May 2001 17:22:07 -0000 1.1.1.3.8.7.2.8.2.4 @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.1.1.3.8.7.2.8.2.3 2001/05/07 13:23:41 rbcollins Exp $ + * $Id: defines.h,v 1.1.1.3.8.7.2.8.2.4 2001/05/10 17:22:07 adri Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -62,6 +62,7 @@ #define COMM_ERR_CONNECT (-7) #define COMM_ERR_DNS (-8) #define COMM_ERR_CLOSING (-9) +#define COMM_EOF (-10) /* Select types. */ #define COMM_SELECT_READ (0x1) Index: squid/src/modules/http_upstream/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/modules/http_upstream/Attic/http.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/src/modules/http_upstream/http.c 9 May 2001 14:11:52 -0000 1.1.2.2 +++ squid/src/modules/http_upstream/http.c 10 May 2001 17:22:07 -0000 1.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.1.2.2 2001/05/09 14:11:52 rbcollins Exp $ + * $Id: http.c,v 1.1.2.3 2001/05/10 17:22:07 adri Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1394,8 +1394,8 @@ temp_filter=http->hcrequest->repfilters.head->data; http->read_offset+=howmuch; /* check for trivial EOF status. */ - #define COMM_EOF 0 - eofflag = ((http->read_offset >= http->rep->content_length) || (flags & COMM_EOF)) ? FILTER_EOF : 0; + eofflag = ((http->read_offset >= http->rep->content_length) || + (flags == COMM_EOF)) ? FILTER_EOF : 0; debug (33,0)("read offset is %d, content length %d\n",http->read_offset, http->rep->content_length); /* FIXME: check for content overrun here */ /* NOTE: however we do this, it must be callable by the TE code as well.. */