--------------------- PatchSet 4930 Date: 2002/09/09 12:33:14 Author: rbcollins Branch: rfc2616 Tag: (none) Log: minor fixes Members: src/http.c:1.21.6.7->1.21.6.8 src/store.c:1.17.2.3->1.17.2.4 Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.21.6.7 retrieving revision 1.21.6.8 diff -u -r1.21.6.7 -r1.21.6.8 --- squid/src/http.c 8 Sep 2002 10:48:10 -0000 1.21.6.7 +++ squid/src/http.c 9 Sep 2002 12:33:14 -0000 1.21.6.8 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.21.6.7 2002/09/08 10:48:10 rbcollins Exp $ + * $Id: http.c,v 1.21.6.8 2002/09/09 12:33:14 rbcollins Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -511,16 +511,17 @@ MemObject *mem = httpState->entry->mem_obj; HttpReply const *reply = mem->reply; int clen; + int rv = 1; debug(11, 3) ("httpPconnTransferDone: FD %d\n", httpState->fd); /* If the reply wants to close the connection, it takes precedence */ if (httpHeaderHasConnDir(&reply->header, "close")) - return 2; + rv = 2; /* * If we didn't send a keep-alive request header, then this * can not be a persistent connection. */ if (!httpState->flags.keepalive) - return 0; + rv = 2; /* * What does the reply have to say about keep-alive? */ @@ -534,7 +535,7 @@ * the server times out the socket. */ if (!reply->keep_alive) - return 0; + rv = 2; debug(11, 5) ("httpPconnTransferDone: content_length=%d\n", reply->content_length); /* If we haven't seen the end of reply headers, we are not done */ @@ -543,7 +544,7 @@ clen = httpReplyBodySize(httpState->request->method, reply); /* If there is no message body, we can be persistent */ if (0 == clen) - return 1; + return rv; /* If the body size is unknown we must wait for EOF */ if (clen < 0) return 0; @@ -551,7 +552,7 @@ if (mem->inmem_hi < reply->content_length + reply->hdr_sz) return 0; /* We got it all */ - return 1; + return rv; } /* This will be called when data is ready to be read from fd. Read until @@ -701,6 +702,7 @@ fwdComplete(httpState->fwd); httpState->fd = -1; httpStateFree(fd, httpState); + break; case 2: /* close the connection ourselves */ /* yes - same as for a complete persistent conn here */ @@ -717,6 +719,7 @@ httpStateFree(fd, httpState); /* TODO: check that fd is still open here */ comm_close (fd); + break; } } } Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.17.2.3 retrieving revision 1.17.2.4 diff -u -r1.17.2.3 -r1.17.2.4 --- squid/src/store.c 8 Sep 2002 07:38:18 -0000 1.17.2.3 +++ squid/src/store.c 9 Sep 2002 12:33:14 -0000 1.17.2.4 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.17.2.3 2002/09/08 07:38:18 rbcollins Exp $ + * $Id: store.c,v 1.17.2.4 2002/09/09 12:33:14 rbcollins Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1303,7 +1303,7 @@ assert(mem->swapout.sio == NULL); stmemFree(&mem->data_hdr); mem->inmem_hi = mem->inmem_lo = 0; - /* SHould we check for clients? */ + /* Should we check for clients? */ httpReplyReset((HttpReply *)mem->reply); e->expires = e->lastmod = e->timestamp = -1; }