Time for the next round ..

From: Adrian Chadd <adrian@dont-contact.us>
Date: Thu, 4 Apr 2002 07:08:41 -0700

Hi all,

Its time for the next round of cleanups. These ones aren't
anywhere near as obtrusive as my old ones but they're just
as important.

The next stage involves removing all of the "fingers" into
the storage manager by various modules. The first round of
fingers that are destined to go are the inmem_lo/inmem_hi
checks - generally to determine whether the object has
either started downloading, or finished downloading.

Here's a quick grep to show that this task isn't very daunting:

adrian@roaming:~/work/squid/squid-cvs/squid-HEAD/src> fgrep inmem_ *.c | grep -v '^store.*c:'
asn.c: if (retsize == 0 && e->mem_obj->inmem_hi > 0) {
asn.c: } else if (asState->offset < e->mem_obj->inmem_hi) {
asn.c: debug(53, 3) ("asHandleReply: asState->offset < e->mem_obj->inmem_hi %s\n", storeUrl(e));
errorpage.c: assert(mem->inmem_hi == 0);
forward.c: if (e->mem_obj->inmem_hi == 0) {
forward.c: if (fwdState->entry->mem_obj->inmem_hi > 0)
forward.c: if (entry->mem_obj->inmem_hi == 0) {
ftp.c: if (entry->mem_obj->inmem_hi == 0)
ftp.c: assert(e->mem_obj->inmem_hi == 0);
ftp.c: reply->hdr_sz = e->mem_obj->inmem_hi;
gopher.c: if (entry->mem_obj->inmem_hi == 0) {
gopher.c: } else if (entry->mem_obj->inmem_hi == 0) {
gopher.c: } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
http.c: if (entry->mem_obj->inmem_hi == 0) {
http.c: if (mem->inmem_hi < reply->content_length + reply->hdr_sz)
http.c: } else if (entry->mem_obj->inmem_hi == 0) {
http.c: } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
mime.c: reply->hdr_sz = e->mem_obj->inmem_hi; /* yuk */
net_db.c: } else if (ex->used < ex->e->mem_obj->inmem_hi) {
net_db.c: debug(38, 3) ("netdbExchangeHandleReply: ex->e->mem_obj->inmem_hi\n");
peer_digest.c: mem->inmem_hi : mem->object_sz;
wais.c: if (entry->mem_obj->inmem_hi == 0) {
wais.c: } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
whois.c: if (0 == mem->inmem_hi)
whois.c: } else if (mem->inmem_hi == 0) {

.. there are a couple more outside of the storage manager, but you can
safely ignore them - they are the references in stat.c for statistics,
and one reference in forward.c to determine whether we need to defer the
read or not.

Now, here's the challenge:

I'd really, really like someone else to do it. I'd like to compare what I do
with someone else's implementation. Its nice and simple in theory - but
it'll involve coming up with a couple of new routines in store.c to return
whether we have received any data, or whether we've recieved _all_ of the
data. You can't just wrap up inmem_hi access via a function that returns the
current hi pointer - that'll go away eventually (at least from the view of the
rest of squid. :-)

Please submit patches against HEAD. I'll be re-creating the commloops branch
tomorrow.

Good luck! :)

Adrian
Received on Thu Apr 04 2002 - 07:08:42 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:57 MST