--------------------- PatchSet 6585 Date: 2005/04/15 00:40:32 Author: swsf Branch: epoll-2_5 Tag: (none) Log: Fixed a condition where we would stop reading from a server, but all clients had seen all received data Members: src/store_client.c:1.9.6.2.18.2->1.9.6.2.18.3 src/store_swapout.c:1.11.2.1.32.4->1.11.2.1.32.5 Index: squid/src/store_client.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_client.c,v retrieving revision 1.9.6.2.18.2 retrieving revision 1.9.6.2.18.3 diff -u -r1.9.6.2.18.2 -r1.9.6.2.18.3 --- squid/src/store_client.c 29 Mar 2005 02:27:27 -0000 1.9.6.2.18.2 +++ squid/src/store_client.c 15 Apr 2005 00:40:32 -0000 1.9.6.2.18.3 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.9.6.2.18.2 2005/03/29 02:27:27 swsf Exp $ + * $Id: store_client.c,v 1.9.6.2.18.3 2005/04/15 00:40:32 swsf Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -277,6 +277,20 @@ if (e->store_status == STORE_PENDING && sc->seen_offset >= mem->inmem_hi) { /* client has already seen this, wait for more */ debug(20, 3) ("storeClientCopy3: Waiting for more\n"); + + /* If the read is backed off and all clients have seen all the data in + memory, re-poll the fd */ + if ( (EBIT_TEST(e->flags, ENTRY_DEFER_READ)) && + (storeLowestMemReaderOffset(e) == mem->inmem_hi) ) { + debug(20, 1) ("storeClientCopy3: %s - clearing ENTRY_DEFER_READ\n,e->mem_obj->url); + /* Clear the flag and re-poll the fd */ + EBIT_CLR(e->flags, ENTRY_DEFER_READ); +#if HAVE_EPOLL + if(mem->serverfd !=0) { + commResumeFD(mem->serverfd); + mem->serverfd=0; + } +#endif return; } /* Index: squid/src/store_swapout.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapout.c,v retrieving revision 1.11.2.1.32.4 retrieving revision 1.11.2.1.32.5 diff -u -r1.11.2.1.32.4 -r1.11.2.1.32.5 --- squid/src/store_swapout.c 14 Apr 2005 00:01:09 -0000 1.11.2.1.32.4 +++ squid/src/store_swapout.c 15 Apr 2005 00:40:41 -0000 1.11.2.1.32.5 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.c,v 1.11.2.1.32.4 2005/04/14 00:01:09 swsf Exp $ + * $Id: store_swapout.c,v 1.11.2.1.32.5 2005/04/15 00:40:41 swsf Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -161,7 +161,7 @@ if (mem->inmem_hi - mem->inmem_lo <= READ_AHEAD_GAP) { EBIT_CLR(e->flags, ENTRY_DEFER_READ); #if HAVE_EPOLL - if(mem->serverfd !=0) { + if(mem->serverfd !=0) { commResumeFD(mem->serverfd); mem->serverfd=0; }