Re: Is there any convient way to transfer Cache Digest Diff ??

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 05 May 2001 22:35:56 +0200

See
<http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/squid/squid/src/Attic/peer_monitor.c?only_with_tag=rproxy&hideattic=0>
for a more isolated example of how to fetch content from within Squid.

--
Henrik Nordstrom
Squid Hacker
ªL­^¶W wrote:
> 
> Dear all:
>        I am trying to implement Diff Cache Digest .But now I meet some
> problems.
> 
>    My problem is that it is difficult to transfer Cache Digest Diff among
> squid proxy server ....
> 
>    I try to register a StoreEntry like  storeDigestRewriteStart() and
> storeDigestRewriteResume() do.
> 
>    but I don't know how to let it's peers get the Cache Digest Diff  because
> the  peerDigestFetchReply()
> 
>    peerDigestSwapInHeaders(),peerDigestSwapInCBlock(),peerDigestSwapInMask()
> is much more
> 
>    complicated, and it's not easy  to modify it ......
> 
>   Can any one tell me a convient way to transfer Cache Digest Diff   ?????
> 
>   Thankx in advance ......
> 
> storeDigestRewriteStart()
> {
> ----------snip---------------
> 
>  #ifdef DIFF_DIGESTS
>     debug(71, 2) ("diffDigestRewrite: start rewrite #%d\n",
> sd_state.rewrite_count + 1);
>     /* make new diff digest entry */
>     url2 = internalLocalUri("/squid-internal-periodic/",
> DiffDigestFileName);
>     flags2 = null_request_flags;
>     flags2.cachable = 1;
>     dd_state.rewrite_lock = e2 = storeCreateEntry(url2, url2, flags2,
> METHOD_GET);
> #endif
> ------------snip---------------
> }
> 
> storeDigestRewriteResume()
> {
> ------------------------snip-------------------
> #ifdef DIFF_DIGESTS
>     dd_state.rewrite_offset = 0;
>     EBIT_SET(e2->flags, ENTRY_SPECIAL);
>     /* setting public key will purge old digest entry if any */
>     storeSetPublicKey(e2);
>     /* fake reply */
>     httpReplyReset(e2->mem_obj->reply);
>     httpReplySetHeaders(e2->mem_obj->reply, 1.0, 200, "Cache Digest OK",
>         "application/cache-digest", diff_digest->mask_size +
> sizeof(sd_state.cblock),
>         squid_curtime, squid_curtime + Config.digest.rewrite_period);
>     debug(71, 3) ("DiffDigestRewrite: entry expires on %d (%+d)\n",
>         e2->mem_obj->reply->expires, e2->mem_obj->reply->expires -
> squid_curtime);
>     storeBuffer(e2);
>     httpReplySwapOut(e2->mem_obj->reply, e2);
>     storeDigestCBlockSwapOut(e2);
>     storeBufferFlush(e2);
> 
> #endif
> ----------------------snip------------------
> }
Received on Sat May 05 2001 - 14:43:19 MDT

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