回复:Re: Puzzled at store_client->seen_offset(copy_offset).

From: <maer727@dont-contact.us>
Date: Sat, 27 Apr 2002 10:58:33 +0800 (CST)

Thanks, Henrik pal!

I have read the related codes in Squid 2.4 and also Squid 2.5.
I think only in HEAD versions of squid(newer than 2.5, I see
2.5 still use seen_offset), the seen_offset is omitted.

I think the copy_offset is always no less than the data available. For
example, the data availble is 100 current, than copy_offset must be no
greated than 100. On the other hand, seen_offset could be any number,
maybe 101 in this case.

So, I think copy_offset must be not greater than data available. Am I correct?

In your case on HTTP header, I think even through sometimes the full header
is not yet available, the copy_offset must be not greated than
the number of data current available. Am I correct?

In other words, copy_offset is just a pointer of the copy buffer whose
value is not greater than current size of the buffer. Copy_offset is the
beginning address of the copy event. Am I correct?

Best regards,
George Ma

----- 原文 -----
From: Henrik Nordstrom
To: maer727@sohu.com
Cc: squid-dev@squid-cache.org
Subject: Re: Puzzled at store_client->seen_offset(copy_offset).
Sent: Sat Apr 27 02:25:56 CST 2002

> The old code uses this when processing HTTP headers. If the full header isn't
> yet available, the caller (the one calling storeClientCopy) indicates that
> the data it got wasn't sufficient and that more is data needed before he can
> process the HTTP header. When more data is available, the old plus the new
> data will be sent to the caller via the callback registered in
> storeClientCopy.
>
> The new code works differently. Now the caller has to buffer the data he
> could not process himself. storeClientCopy will only return the new data.
>
> Regards
> Henrik
>
> maer727@sohu.com wrote:
> > Thanks, Henrik pal!
> >
> > What means the following in you reply?
> >
> >
> > They differ in the case where the data available is not sufficient to
> > process it. In such case seen_offset is greater than copy_offset.
> >
> > I search it in clientHandleIMSReply, client_cide.c and find sometimes
> > the value are different.
> >
> > But the case you mentioned puzzled me, I do not understand your case.
> > Can you give me a more detailed descrption on your case?
> >
> > Bset regards,
> > George Ma
> >
> > ----- 原文 -----
> > From: Henrik Nordstrom
> > To: maer727@sohu.com
> > Cc: squid-dev@squid-cache.org
> > Subject: Re: =?gb2312?q?=BB=D8=B8=B4=3ARe=3A=20Puzzled=20at?=
> > store_client->seen_offset(copy_offset). Sent: Wed Apr 24 14:25:44 CST 2002
> >
> > > Valid enoug reason to look at the 2.4 code..
> > >
> > > Both are from the storeClientCopy() call.
> > >
> > > seen_offset == I (the one calling storeClientCopy) have already seen up
> > > to this point in the object. Don't bother me until there is more data
> > > available.
> > >
> > > copy_offset == I want data starting at this offset in the object.
> > >
> > > They differ in the case where the data available is not sufficient to
> > > process it. In such case seen_offset is greater than copy_offset.
> > >
> > > Regards
> > > Henrik
> > >
> > > maer727@sohu.com wrote:
> > > > Thanks, Henrik pal!
> > > >
> > > > I think it is no use to understand seen_offset but
> > > > what is the meaning and function of copy_offset? :-)
> > > >
> > > > Btw: my work now in my lab is to develop a system which is based
> > > > on squid-2.4, so if it does not matter very much, can you give me
> > > > a simple explanation about the meaning and function of the variable?
> > > > :-) I am reading the source of a content delivery system which is based
> > > > on squid-2.4. Our aim is to adapt it to freeware. Now it is not a
> > > > freeware and just used in the lab. You know, reading earlier version of
> > > > software is a boring thing but I have to do it. :-(
> > > >
> > > > I have skip as much as possible in earlier versions of Squid but I
> > > > think I can not skip seen_offset, without it I can not understand the
> > > > memory format of the store_client.
> > > >
> > > > I am a newbie of Squid and our system. I will thank again for your help
> > > > these days.
> > > >
> > > > Best regards,
> > > > George Ma
> > > > ----- 原文 -----
> > > > From: Henrik Nordstrom
> > > > To: maer727@sohu.com ;squid-dev@squid-cache.org
> > > > Subject: Re: Puzzled at store_client->seen_offset(copy_offset).
> > > > Sent: Wed Apr 24 00:05:42 CST 2002
> > > >
> > > > > seen_offset no longer exists in Squid-HEAD. I see no reason to
> > > > > explain this odd and error prone design which we have already decided
> > > > > to abandon.
> > > > >
> > > > > Regards
> > > > > Henrik
> > > > >
> > > > > maer727@sohu.com wrote:
> > > > > > Hi, pals!
> > > > > >
> > > > > > What is the meaning and function of store_client->seen_offset?
> > > > > > I search store_client->seen_offset is source files. I find
> > > > > > only store.c and stat.c use the variable. But I failed to find
> > > > > > the meaning and function of the variable.
> > > > > >
> > > > > > Can you give me a simple explanation about the meaning and
> > > > > > fucntion of store_client->seen_offset and
> > > > > > store_client->copy_offset? What is the difference between
> > > > > > store_client->seen_offset and store_ client->copy_offset?
......
Received on Fri Apr 26 2002 - 20:58:35 MDT

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