#include "squid.h"
#include "event.h"
+#include "globals.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "MemBuf.h"
PROF_stop(InvokeHandlers);
}
-// XXX: Does not account for remote readers of local writers, causing
-// premature StoreEntry aborts.
+// Does not account for remote readers/clients.
int
storePendingNClients(const StoreEntry * e)
{
return true;
}
+/// Aborts a swapping-out entry if nobody needs it any more _and_
+/// continuing swap out is not reasonable per CheckQuickAbortIsReasonable().
static void
CheckQuickAbort(StoreEntry * entry)
{
if (storePendingNClients(entry) > 0)
return;
+ if (!shutting_down && Store::Root().transientReaders(*entry))
+ return;
+
if (entry->store_status != STORE_PENDING)
return;