Re: squid cache information - help

From: ccmail111 <ccmail111@dont-contact.us>
Date: Tue, 13 Feb 2007 14:54:49 -0800 (PST)

Hi Alex,

Thank you very much for your valuable input.

Question:
To enable SQUID3.x proxy save the page in file,
I modified code as follows, but unable get the page.

I did:

File: store_client.cc
In function:
static void
storeClientReadBody(void *data, const char *buf,
ssize_t len, StoreIOState::Pointer self)
{

....

    debug(90, 3)("storeClientReadBody: len %d", (int)
len);

....
>>>>> new code start here..

    {
    int rc = 0;
    FILE *ffd = 0;
    char fbuf[256];

    memset(fbuf, 0, sizeof(fbuf));
    strcpy(fbuf, "/tmp/");
    strcat(fbuf, sc->entry->getMD5Text());
    ffd = fopen(fbuf, "a+");
    if (!ffd) {
        fprintf(stderr,"TEST: file name: %s, ffd: %p,
rc: (%s), name: %s, len: %d\n",
                fbuf, ffd, strerror(errno),
sc->entry->getMD5Text(), len);
    }
    rc = fwrite(buf, 1, len, ffd );
    if (rc < 0) {
        fprintf(stderr,"TEST: write rc: %d : %s: ffd:
%p \n", rc, strerror(errno), ffd);
    }
        fclose(ffd);
    }
>>>>> new code end here

}

# ls -l /tmp/02179C10E9E2DD4469A79C8E6456895A
-rw-r--r-- 1 nobody nobody 1202 Feb 13 14:49
/tmp/02179C10E9E2DD4469A79C8E6456895A

# file /tmp/02179C10E9E2DD4469A79C8E6456895A
/tmp/02179C10E9E2DD4469A79C8E6456895A: data

# file /tmp/4A91DC3958CA0F5D657F5C262252D738
/tmp/4A91DC3958CA0F5D657F5C262252D738: data

# ls -l /tmp/4A91DC3958CA0F5D657F5C262252D738
-rw-r--r-- 1 nobody nobody 20706 Feb 13 14:49
/tmp/4A91DC3958CA0F5D657F5C262252D738

I see the files being created, but contents are
control characters (garbled).

Any suggestions ?

Thanks !

MC

--- Alex Rousskov <rousskov@measurement-factory.com>
wrote:

> On Thu, 2007-02-08 at 14:05 -0800, ccmail111 wrote:
>
> > I have: squid-3.0.PRE5-20061215 on Linux.
> > I am looking to understand how SQUID3.x stores
> > (in no cache mode) the responses received from
> Http
> > server - HTTP payload (including images etc.
> received
> > and retrieved from different sites).
> >
> > I need this information to tie it to my backend
> program
> > which does audit and such.
> > I have some APIs like stdlib (linux) and would
> like
> > to call them from appropriate locations from
> SQUID.
> >
> > Any help/pointers is appreciated !
>
> Similar questions have been discussed a few times
> recently. You may want
> to search the list archive for the word ICAP. While
> not all suggested
> solutions involve ICAP, the protocol is usually
> mentioned at least once
> in the relevant thread.
>
> Here is an example of a thread offering up to four
> starting points for
> your question:
>
http://thread.gmane.org/gmane.comp.web.squid.devel/4048/
>
> This recent thread may also be relevant:
>
http://thread.gmane.org/gmane.comp.web.squid.devel/4197/
>
> HTH,
>
> Alex.
>
>
>

 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
Received on Tue Feb 13 2007 - 15:54:57 MST

This archive was generated by hypermail pre-2.1.9 : Thu Mar 01 2007 - 12:00:02 MST