Download hanging

From: Steven <swilton@dont-contact.us>
Date: Sat, 5 Aug 2006 15:45:33 +0800 (WST)

I had a problem today where a download for a particular file was hanging
forever after 128k. It looks like the store entry had the release
request flag set, but because all the data had been sent to the client
and the server side was being deferred, there was nothing to kick the
store entry into freeing the memory.

I think the patch below is the correct fix (don't defer if all clients
have seen all data). I wanted to check before committing it.

Steven

Index: src/forward.c
===================================================================
RCS file: /server/cvs-server/squid/squid/src/forward.c,v
retrieving revision 1.115
diff -u -r1.115 forward.c
--- src/forward.c 30 Jun 2006 21:23:05 -0000 1.115
+++ src/forward.c 5 Aug 2006 07:33:46 -0000
@@ -927,8 +927,10 @@
         * few other corner cases.
         */
        if (fd >= 0 && mem->inmem_hi - mem->inmem_lo > SM_PAGE_SIZE +
Config.Store.maxInMemObjSize + Config.readAheadGap) {
- storeDeferRead(e, fd);
- return 1;
+ if(storeLowestMemReaderOffset(e) != mem->inmem_hi) {
+ storeDeferRead(e, fd);
+ return 1;
+ }
        }
     }
     if (fd >= 0 && mem->inmem_hi - storeLowestMemReaderOffset(e) >
Config.readAheadGap) {
Received on Sat Aug 05 2006 - 01:45:39 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Sep 01 2006 - 12:00:03 MDT