/*
- * $Id: Store.h,v 1.15 2005/01/06 03:22:22 robertc Exp $
+ * $Id: Store.h,v 1.16 2005/11/21 22:20:12 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
virtual HttpReply const *getReply() const;
virtual void write (StoreIOBuffer);
virtual _SQUID_INLINE_ bool isEmpty() const;
+ virtual bool isAccepting() const;
virtual size_t bytesWanted(Range<size_t> const) const;
virtual void complete();
virtual store_client_t storeClientType() const;
/*
- * $Id: store.cc,v 1.580 2005/11/05 00:08:32 wessels Exp $
+ * $Id: store.cc,v 1.581 2005/11/21 22:20:12 wessels Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
StoreIOBuffer tempBuffer;
tempBuffer.data = (char *)buf;
tempBuffer.length = len;
+ /*
+ * XXX sigh, offset might be < 0 here, but it gets "corrected"
+ * later. This offset crap is such a mess.
+ */
tempBuffer.offset = mem->endOffset() - (e->getReply() ? e->getReply()->hdr_sz : 0);
e->write(tempBuffer);
}
store()->unlink(*this);
}
+/*
+ * return true if the entry is in a state where
+ * it can accept more data (ie with write() method)
+ */
+bool
+StoreEntry::isAccepting() const
+{
+ if (STORE_PENDING != store_status)
+ return false;
+
+ if (EBIT_TEST(flags, ENTRY_ABORTED))
+ return false;
+
+ return true;
+}
+
/* NullStoreEntry */
NullStoreEntry NullStoreEntry::_instance;