peer_digest.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 72 Peer Digest Routines */
10 
11 #include "squid.h"
12 #if USE_CACHE_DIGESTS
13 #include "CacheDigest.h"
14 #include "CachePeer.h"
15 #include "event.h"
16 #include "FwdState.h"
17 #include "globals.h"
18 #include "HttpReply.h"
19 #include "HttpRequest.h"
20 #include "internal.h"
21 #include "MemObject.h"
22 #include "mime_header.h"
23 #include "neighbors.h"
24 #include "PeerDigest.h"
25 #include "SquidTime.h"
26 #include "Store.h"
27 #include "store_key_md5.h"
28 #include "StoreClient.h"
29 #include "tools.h"
30 #include "util.h"
31 
32 /* local types */
33 
34 /* local prototypes */
35 static time_t peerDigestIncDelay(const PeerDigest * pd);
36 static time_t peerDigestNewDelay(const StoreEntry * e);
37 static void peerDigestSetCheck(PeerDigest * pd, time_t delay);
39 static void peerDigestRequest(PeerDigest * pd);
41 static int peerDigestFetchReply(void *, char *, ssize_t);
42 int peerDigestSwapInHeaders(void *, char *, ssize_t);
43 int peerDigestSwapInCBlock(void *, char *, ssize_t);
44 int peerDigestSwapInMask(void *, char *, ssize_t);
45 static int peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const char *step_name);
46 static void peerDigestFetchStop(DigestFetchState * fetch, char *buf, const char *reason);
47 static void peerDigestFetchAbort(DigestFetchState * fetch, char *buf, const char *reason);
48 static void peerDigestReqFinish(DigestFetchState * fetch, char *buf, int, int, int, const char *reason, int err);
49 static void peerDigestPDFinish(DigestFetchState * fetch, int pcb_valid, int err);
50 static void peerDigestFetchFinish(DigestFetchState * fetch, int err);
51 static void peerDigestFetchSetStats(DigestFetchState * fetch);
52 static int peerDigestSetCBlock(PeerDigest * pd, const char *buf);
53 static int peerDigestUseful(const PeerDigest * pd);
54 
55 /* local constants */
56 Version const CacheDigestVer = { 5, 3 };
57 
58 #define StoreDigestCBlockSize sizeof(StoreDigestCBlock)
59 
60 /* min interval for requesting digests from a given peer */
61 static const time_t PeerDigestReqMinGap = 5 * 60; /* seconds */
62 /* min interval for requesting digests (cumulative request stream) */
63 static const time_t GlobDigestReqMinGap = 1 * 60; /* seconds */
64 
65 /* local vars */
66 
67 static time_t pd_last_req_time = 0; /* last call to Check */
68 
70 {
71  assert(p);
72 
73  /*
74  * DPW 2007-04-12
75  * Lock on to the peer here. The corresponding cbdataReferenceDone()
76  * is in peerDigestDestroy().
77  */
78  peer = cbdataReference(p);
79  /* if peer disappears, we will know it's name */
80  host = p->host;
81 
82  times.initialized = squid_curtime;
83 }
84 
86 
88 
90  pd(cbdataReference(aPd)),
91  entry(NULL),
92  old_entry(NULL),
93  sc(NULL),
94  old_sc(NULL),
95  request(req),
96  offset(0),
97  mask_offset(0),
98  start_time(squid_curtime),
99  resp_time(0),
100  expires(0),
101  bufofs(0),
102  state(DIGEST_READ_REPLY)
103 {
105 
106  sent.msg = 0;
107  sent.bytes = 0;
108 
109  recv.msg = 0;
110  recv.bytes = 0;
111 
112  *buf = 0;
113 }
114 
116 {
117  /* unlock everything */
118  storeUnregister(sc, entry, this);
119 
120  entry->unlock("DigestFetchState destructed");
121  entry = NULL;
122 
124 
125  assert(pd == NULL);
126 }
127 
128 /* allocate new peer digest, call Init, and lock everything */
129 void
131 {
132  assert(p);
133 
134  PeerDigest *pd = new PeerDigest(p);
135 
136  // TODO: make CachePeer member a CbcPointer
137  p->digest = cbdataReference(pd);
138 
139  // lock a reference to pd again to prevent the PeerDigest
140  // disappearing during peerDigestDestroy() when
141  // cbdataReferenceValidDone is called.
142  // TODO test if it can be moved into peerDigestDestroy() or
143  // if things can break earlier (eg CachePeer death).
144  (void)cbdataReference(pd);
145 }
146 
147 /* call Clean and free/unlock everything */
148 static void
150 {
151  void *p;
152  assert(pd);
153  void * peerTmp = pd->peer;
154 
155  /*
156  * DPW 2007-04-12
157  * We locked the peer in PeerDigest constructor, this is
158  * where we unlock it.
159  */
160  if (cbdataReferenceValidDone(peerTmp, &p)) {
161  // we locked the p->digest in peerDigestCreate()
162  // this is where we unlock that
163  cbdataReferenceDone(static_cast<CachePeer *>(p)->digest);
164  }
165 
166  delete pd;
167 }
168 
170 {
171  delete cd;
172  // req_result pointer is not owned by us
173 }
174 
175 /* called by peer to indicate that somebody actually needs this digest */
176 void
178 {
179  assert(pd);
180  assert(!pd->flags.needed);
181  assert(!pd->cd);
182 
183  pd->flags.needed = true;
184  pd->times.needed = squid_curtime;
185  peerDigestSetCheck(pd, 0); /* check asap */
186 }
187 
188 /* increment retry delay [after an unsuccessful attempt] */
189 static time_t
191 {
192  assert(pd);
193  return pd->times.retry_delay > 0 ?
194  2 * pd->times.retry_delay : /* exponential backoff */
195  PeerDigestReqMinGap; /* minimal delay */
196 }
197 
198 /* artificially increases Expires: setting to avoid race conditions
199  * returns the delay till that [increased] expiration time */
200 static time_t
202 {
203  assert(e);
204 
205  if (e->expires > 0)
207 
208  return PeerDigestReqMinGap;
209 }
210 
211 /* registers next digest verification */
212 static void
213 peerDigestSetCheck(PeerDigest * pd, time_t delay)
214 {
215  eventAdd("peerDigestCheck", peerDigestCheck, pd, (double) delay, 1);
216  pd->times.next_check = squid_curtime + delay;
217  debugs(72, 3, "peerDigestSetCheck: will check peer " << pd->host << " in " << delay << " secs");
218 }
219 
220 /*
221  * called when peer is about to disappear or have already disappeared
222  */
223 void
225 {
226  if (pd->flags.requested) {
227  debugs(72, 2, "peerDigest: peer " << pd->host << " gone, will destroy after fetch.");
228  /* do nothing now, the fetching chain will notice and take action */
229  } else {
230  debugs(72, 2, "peerDigest: peer " << pd->host << " is gone, destroying now.");
231  peerDigestDestroy(pd);
232  }
233 }
234 
235 /* callback for eventAdd() (with peer digest locked)
236  * request new digest if our copy is too old or if we lack one;
237  * schedule next check otherwise */
238 static void
239 peerDigestCheck(void *data)
240 {
241  PeerDigest *pd = (PeerDigest *)data;
242  time_t req_time;
243 
244  assert(!pd->flags.requested);
245 
246  pd->times.next_check = 0; /* unknown */
247 
248  if (!cbdataReferenceValid(pd->peer)) {
250  return;
251  }
252 
253  debugs(72, 3, "peerDigestCheck: peer " << pd->peer->host << ":" << pd->peer->http_port);
254  debugs(72, 3, "peerDigestCheck: time: " << squid_curtime <<
255  ", last received: " << (long int) pd->times.received << " (" <<
256  std::showpos << (int) (squid_curtime - pd->times.received) << ")");
257 
258  /* decide when we should send the request:
259  * request now unless too close to other requests */
260  req_time = squid_curtime;
261 
262  /* per-peer limit */
263 
264  if (req_time - pd->times.received < PeerDigestReqMinGap) {
265  debugs(72, 2, "peerDigestCheck: " << pd->host <<
266  ", avoiding close peer requests (" <<
267  (int) (req_time - pd->times.received) << " < " <<
268  (int) PeerDigestReqMinGap << " secs).");
269 
270  req_time = pd->times.received + PeerDigestReqMinGap;
271  }
272 
273  /* global limit */
274  if (req_time - pd_last_req_time < GlobDigestReqMinGap) {
275  debugs(72, 2, "peerDigestCheck: " << pd->host <<
276  ", avoiding close requests (" <<
277  (int) (req_time - pd_last_req_time) << " < " <<
278  (int) GlobDigestReqMinGap << " secs).");
279 
281  }
282 
283  if (req_time <= squid_curtime)
284  peerDigestRequest(pd); /* will set pd->flags.requested */
285  else
286  peerDigestSetCheck(pd, req_time - squid_curtime);
287 }
288 
289 /* ask store for a digest */
290 static void
292 {
293  CachePeer *p = pd->peer;
294  StoreEntry *e, *old_e;
295  char *url = NULL;
296  HttpRequest *req;
297  StoreIOBuffer tempBuffer;
298 
299  pd->req_result = NULL;
300  pd->flags.requested = true;
301 
302  /* compute future request components */
303 
304  if (p->digest_url)
305  url = xstrdup(p->digest_url);
306  else
307  url = xstrdup(internalRemoteUri(p->secure.encryptTransport, p->host, p->http_port, "/squid-internal-periodic/", SBuf(StoreDigestFileName)));
308  debugs(72, 2, url);
309 
311  req = HttpRequest::FromUrlXXX(url, mx);
312 
313  assert(req);
314 
315  /* add custom headers */
316  assert(!req->header.len);
317 
319 
320  req->header.putStr(Http::HdrType::ACCEPT, "text/html");
321 
322  if (p->login &&
323  p->login[0] != '*' &&
324  strcmp(p->login, "PASS") != 0 &&
325  strcmp(p->login, "PASSTHRU") != 0 &&
326  strncmp(p->login, "NEGOTIATE",9) != 0 &&
327  strcmp(p->login, "PROXYPASS") != 0) {
328  req->url.userInfo(SBuf(p->login)); // XXX: performance regression make peer login SBuf as well.
329  }
330  /* create fetch state structure */
331  DigestFetchState *fetch = new DigestFetchState(pd, req);
332 
333  /* update timestamps */
336  req->flags.cachable = true;
337 
338  /* the rest is based on clientReplyContext::processExpired() */
339  req->flags.refresh = true;
340 
341  old_e = fetch->old_entry = storeGetPublicByRequest(req);
342 
343  // XXX: Missing a hittingRequiresCollapsing() && startCollapsingOn() check.
344  if (old_e) {
345  debugs(72, 5, "found old " << *old_e);
346 
347  old_e->lock("peerDigestRequest");
348  old_e->ensureMemObject(url, url, req->method);
349 
350  fetch->old_sc = storeClientListAdd(old_e, fetch);
351  }
352 
353  e = fetch->entry = storeCreateEntry(url, url, req->flags, req->method);
354  debugs(72, 5, "created " << *e);
356  fetch->sc = storeClientListAdd(e, fetch);
357  /* set lastmod to trigger IMS request if possible */
358 
359  if (old_e)
360  e->lastModified(old_e->lastModified());
361 
362  /* push towards peer cache */
364 
365  tempBuffer.offset = 0;
366 
367  tempBuffer.length = SM_PAGE_SIZE;
368 
369  tempBuffer.data = fetch->buf;
370 
371  storeClientCopy(fetch->sc, e, tempBuffer,
372  peerDigestHandleReply, fetch);
373 
374  safe_free(url);
375 }
376 
377 /* Handle the data copying .. */
378 
379 /*
380  * This routine handles the copy data and then redirects the
381  * copy to a bunch of subfunctions depending upon the copy state.
382  * It also tracks the buffer offset and "seen", since I'm actually
383  * not interested in rewriting everything to suit my little idea.
384  */
385 static void
386 peerDigestHandleReply(void *data, StoreIOBuffer receivedData)
387 {
388  DigestFetchState *fetch = (DigestFetchState *)data;
389  int retsize = -1;
390  digest_read_state_t prevstate;
391  int newsize;
392 
393  assert(fetch->pd && receivedData.data);
394  /* The existing code assumes that the received pointer is
395  * where we asked the data to be put
396  */
397  assert(fetch->buf + fetch->bufofs == receivedData.data);
398 
399  /* Update the buffer size */
400  fetch->bufofs += receivedData.length;
401 
402  assert(fetch->bufofs <= SM_PAGE_SIZE);
403 
404  /* If we've fetched enough, return */
405 
406  if (peerDigestFetchedEnough(fetch, fetch->buf, fetch->bufofs, "peerDigestHandleReply"))
407  return;
408 
409  /* Call the right function based on the state */
410  /* (Those functions will update the state if needed) */
411 
412  /* Give us a temporary reference. Some of the calls we make may
413  * try to destroy the fetch structure, and we like to know if they
414  * do
415  */
416  CbcPointer<DigestFetchState> tmpLock = fetch;
417 
418  /* Repeat this loop until we're out of data OR the state changes */
419  /* (So keep going if the state has changed and we still have data */
420  do {
421  prevstate = fetch->state;
422 
423  switch (fetch->state) {
424 
425  case DIGEST_READ_REPLY:
426  retsize = peerDigestFetchReply(fetch, fetch->buf, fetch->bufofs);
427  break;
428 
429  case DIGEST_READ_HEADERS:
430  retsize = peerDigestSwapInHeaders(fetch, fetch->buf, fetch->bufofs);
431  break;
432 
433  case DIGEST_READ_CBLOCK:
434  retsize = peerDigestSwapInCBlock(fetch, fetch->buf, fetch->bufofs);
435  break;
436 
437  case DIGEST_READ_MASK:
438  retsize = peerDigestSwapInMask(fetch, fetch->buf, fetch->bufofs);
439  break;
440 
441  case DIGEST_READ_NONE:
442  break;
443 
444  case DIGEST_READ_DONE:
445  return;
446  break;
447 
448  default:
449  fatal("Bad digest transfer mode!\n");
450  }
451 
452  if (retsize < 0)
453  return;
454 
455  /*
456  * The returned size indicates how much of the buffer was read -
457  * so move the remainder of the buffer to the beginning
458  * and update the bufofs / bufsize
459  */
460  newsize = fetch->bufofs - retsize;
461 
462  memmove(fetch->buf, fetch->buf + retsize, fetch->bufofs - newsize);
463 
464  fetch->bufofs = newsize;
465 
466  } while (cbdataReferenceValid(fetch) && prevstate != fetch->state && fetch->bufofs > 0);
467 
468  // Check for EOF here, thus giving the parser one extra run. We could avoid this overhead by
469  // checking at the beginning of this function. However, in this case, we would have to require
470  // that the parser does not regard EOF as a special condition (it is true now but may change
471  // in the future).
472  if (!receivedData.length) { // EOF
473  peerDigestFetchAbort(fetch, fetch->buf, "premature end of digest reply");
474  return;
475  }
476 
477  /* Update the copy offset */
478  fetch->offset += receivedData.length;
479 
480  /* Schedule another copy */
481  if (cbdataReferenceValid(fetch)) {
482  StoreIOBuffer tempBuffer;
483  tempBuffer.offset = fetch->offset;
484  tempBuffer.length = SM_PAGE_SIZE - fetch->bufofs;
485  tempBuffer.data = fetch->buf + fetch->bufofs;
486  storeClientCopy(fetch->sc, fetch->entry, tempBuffer,
487  peerDigestHandleReply, fetch);
488  }
489 }
490 
491 /* wait for full http headers to be received then parse them */
492 /*
493  * This routine handles parsing the reply line.
494  * If the reply line indicates an OK, the same data is thrown
495  * to SwapInHeaders(). If the reply line is a NOT_MODIFIED,
496  * we simply stop parsing.
497  */
498 static int
499 peerDigestFetchReply(void *data, char *buf, ssize_t size)
500 {
501  DigestFetchState *fetch = (DigestFetchState *)data;
502  PeerDigest *pd = fetch->pd;
503  size_t hdr_size;
504  assert(pd && buf);
505  assert(!fetch->offset);
506 
507  assert(fetch->state == DIGEST_READ_REPLY);
508 
509  if (peerDigestFetchedEnough(fetch, buf, size, "peerDigestFetchReply"))
510  return -1;
511 
512  if ((hdr_size = headersEnd(buf, size))) {
513  const auto &reply = fetch->entry->mem().freshestReply();
514  const auto status = reply.sline.status();
515  assert(status != Http::scNone);
516  debugs(72, 3, "peerDigestFetchReply: " << pd->host << " status: " << status <<
517  ", expires: " << (long int) reply.expires << " (" << std::showpos <<
518  (int) (reply.expires - squid_curtime) << ")");
519 
520  /* this "if" is based on clientHandleIMSReply() */
521 
522  if (status == Http::scNotModified) {
523  /* our old entry is fine */
524  assert(fetch->old_entry);
525 
526  if (!fetch->old_entry->mem_obj->request)
527  fetch->old_entry->mem_obj->request = fetch->entry->mem_obj->request;
528 
529  assert(fetch->old_entry->mem_obj->request);
530 
531  Store::Root().updateOnNotModified(fetch->old_entry, *fetch->entry);
532 
533  /* get rid of 304 reply */
534  storeUnregister(fetch->sc, fetch->entry, fetch);
535 
536  fetch->entry->unlock("peerDigestFetchReply 304");
537 
538  fetch->entry = fetch->old_entry;
539 
540  fetch->old_entry = NULL;
541 
542  /* preserve request -- we need its size to update counters */
543  /* requestUnlink(r); */
544  /* fetch->entry->mem_obj->request = NULL; */
545  } else if (status == Http::scOkay) {
546  /* get rid of old entry if any */
547 
548  if (fetch->old_entry) {
549  debugs(72, 3, "peerDigestFetchReply: got new digest, releasing old one");
550  storeUnregister(fetch->old_sc, fetch->old_entry, fetch);
551  fetch->old_entry->releaseRequest();
552  fetch->old_entry->unlock("peerDigestFetchReply 200");
553  fetch->old_entry = NULL;
554  }
555  } else {
556  /* some kind of a bug */
557  peerDigestFetchAbort(fetch, buf, reply.sline.reason());
558  return -1; /* XXX -1 will abort stuff in ReadReply! */
559  }
560 
561  /* must have a ready-to-use store entry if we got here */
562  /* can we stay with the old in-memory digest? */
563  if (status == Http::scNotModified && fetch->pd->cd) {
564  peerDigestFetchStop(fetch, buf, "Not modified");
565  fetch->state = DIGEST_READ_DONE;
566  } else {
567  fetch->state = DIGEST_READ_HEADERS;
568  }
569  } else {
570  /* need more data, do we have space? */
571 
572  if (size >= SM_PAGE_SIZE)
573  peerDigestFetchAbort(fetch, buf, "reply header too big");
574  }
575 
576  /* We don't want to actually ack that we've handled anything,
577  * otherwise SwapInHeaders() won't get the reply line .. */
578  return 0;
579 }
580 
581 /* fetch headers from disk, pass on to SwapInCBlock */
582 int
583 peerDigestSwapInHeaders(void *data, char *buf, ssize_t size)
584 {
585  DigestFetchState *fetch = (DigestFetchState *)data;
586  size_t hdr_size;
587 
588  assert(fetch->state == DIGEST_READ_HEADERS);
589 
590  if (peerDigestFetchedEnough(fetch, buf, size, "peerDigestSwapInHeaders"))
591  return -1;
592 
593  assert(!fetch->offset);
594 
595  if ((hdr_size = headersEnd(buf, size))) {
596  const auto &reply = fetch->entry->mem().freshestReply();
597  const auto status = reply.sline.status();
598  assert(status != Http::scNone);
599 
600  if (status != Http::scOkay) {
601  debugs(72, DBG_IMPORTANT, "peerDigestSwapInHeaders: " << fetch->pd->host <<
602  " status " << status << " got cached!");
603 
604  peerDigestFetchAbort(fetch, buf, "internal status error");
605  return -1;
606  }
607 
608  fetch->state = DIGEST_READ_CBLOCK;
609  return hdr_size; /* Say how much data we read */
610  }
611 
612  /* need more data, do we have space? */
613  if (size >= SM_PAGE_SIZE) {
614  peerDigestFetchAbort(fetch, buf, "stored header too big");
615  return -1;
616  }
617 
618  return 0; /* We need to read more to parse .. */
619 }
620 
621 int
622 peerDigestSwapInCBlock(void *data, char *buf, ssize_t size)
623 {
624  DigestFetchState *fetch = (DigestFetchState *)data;
625 
626  assert(fetch->state == DIGEST_READ_CBLOCK);
627 
628  if (peerDigestFetchedEnough(fetch, buf, size, "peerDigestSwapInCBlock"))
629  return -1;
630 
631  if (size >= (ssize_t)StoreDigestCBlockSize) {
632  PeerDigest *pd = fetch->pd;
633 
634  assert(pd);
635  assert(fetch->entry->mem_obj);
636 
637  if (peerDigestSetCBlock(pd, buf)) {
638  /* XXX: soon we will have variable header size */
639  /* switch to CD buffer and fetch digest guts */
640  buf = NULL;
641  assert(pd->cd->mask);
642  fetch->state = DIGEST_READ_MASK;
643  return StoreDigestCBlockSize;
644  } else {
645  peerDigestFetchAbort(fetch, buf, "invalid digest cblock");
646  return -1;
647  }
648  }
649 
650  /* need more data, do we have space? */
651  if (size >= SM_PAGE_SIZE) {
652  peerDigestFetchAbort(fetch, buf, "digest cblock too big");
653  return -1;
654  }
655 
656  return 0; /* We need more data */
657 }
658 
659 int
660 peerDigestSwapInMask(void *data, char *buf, ssize_t size)
661 {
662  DigestFetchState *fetch = (DigestFetchState *)data;
663  PeerDigest *pd;
664 
665  pd = fetch->pd;
666  assert(pd->cd && pd->cd->mask);
667 
668  /*
669  * NOTENOTENOTENOTENOTE: buf doesn't point to pd->cd->mask anymore!
670  * we need to do the copy ourselves!
671  */
672  memcpy(pd->cd->mask + fetch->mask_offset, buf, size);
673 
674  /* NOTE! buf points to the middle of pd->cd->mask! */
675 
676  if (peerDigestFetchedEnough(fetch, NULL, size, "peerDigestSwapInMask"))
677  return -1;
678 
679  fetch->mask_offset += size;
680 
681  if (fetch->mask_offset >= pd->cd->mask_size) {
682  debugs(72, 2, "peerDigestSwapInMask: Done! Got " <<
683  fetch->mask_offset << ", expected " << pd->cd->mask_size);
684  assert(fetch->mask_offset == pd->cd->mask_size);
685  assert(peerDigestFetchedEnough(fetch, NULL, 0, "peerDigestSwapInMask"));
686  return -1; /* XXX! */
687  }
688 
689  /* We always read everything, so return size */
690  return size;
691 }
692 
693 static int
694 peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const char *step_name)
695 {
696  static const SBuf hostUnknown("<unknown>"); // peer host (if any)
697  SBuf host = hostUnknown;
698 
699  PeerDigest *pd = NULL;
700  const char *reason = NULL; /* reason for completion */
701  const char *no_bug = NULL; /* successful completion if set */
702  const int pdcb_valid = cbdataReferenceValid(fetch->pd);
703  const int pcb_valid = cbdataReferenceValid(fetch->pd->peer);
704 
705  /* test possible exiting conditions (the same for most steps!)
706  * cases marked with '?!' should not happen */
707 
708  if (!reason) {
709  if (!(pd = fetch->pd))
710  reason = "peer digest disappeared?!";
711  else
712  host = pd->host;
713  }
714 
715  debugs(72, 6, step_name << ": peer " << host << ", offset: " <<
716  fetch->offset << " size: " << size << ".");
717 
718  /* continue checking (with pd and host known and valid) */
719 
720  if (!reason) {
721  if (!cbdataReferenceValid(pd->peer))
722  reason = "peer disappeared";
723  else if (size < 0)
724  reason = "swap failure";
725  else if (!fetch->entry)
726  reason = "swap aborted?!";
727  else if (EBIT_TEST(fetch->entry->flags, ENTRY_ABORTED))
728  reason = "swap aborted";
729  }
730 
731  /* continue checking (maybe-successful eof case) */
732  if (!reason && !size) {
733  if (!pd->cd)
734  reason = "null digest?!";
735  else if (fetch->mask_offset != pd->cd->mask_size)
736  reason = "premature end of digest?!";
737  else if (!peerDigestUseful(pd))
738  reason = "useless digest";
739  else
740  reason = no_bug = "success";
741  }
742 
743  /* finish if we have a reason */
744  if (reason) {
745  const int level = strstr(reason, "?!") ? 1 : 3;
746  debugs(72, level, "" << step_name << ": peer " << host << ", exiting after '" << reason << "'");
747  peerDigestReqFinish(fetch, buf,
748  1, pdcb_valid, pcb_valid, reason, !no_bug);
749  } else {
750  /* paranoid check */
751  assert(pdcb_valid && pcb_valid);
752  }
753 
754  return reason != NULL;
755 }
756 
757 /* call this when all callback data is valid and fetch must be stopped but
758  * no error has occurred (e.g. we received 304 reply and reuse old digest) */
759 static void
760 peerDigestFetchStop(DigestFetchState * fetch, char *buf, const char *reason)
761 {
762  assert(reason);
763  debugs(72, 2, "peerDigestFetchStop: peer " << fetch->pd->host << ", reason: " << reason);
764  peerDigestReqFinish(fetch, buf, 1, 1, 1, reason, 0);
765 }
766 
767 /* call this when all callback data is valid but something bad happened */
768 static void
769 peerDigestFetchAbort(DigestFetchState * fetch, char *buf, const char *reason)
770 {
771  assert(reason);
772  debugs(72, 2, "peerDigestFetchAbort: peer " << fetch->pd->host << ", reason: " << reason);
773  peerDigestReqFinish(fetch, buf, 1, 1, 1, reason, 1);
774 }
775 
776 /* complete the digest transfer, update stats, unlock/release everything */
777 static void
778 peerDigestReqFinish(DigestFetchState * fetch, char * /* buf */,
779  int fcb_valid, int pdcb_valid, int pcb_valid,
780  const char *reason, int err)
781 {
782  assert(reason);
783 
784  /* must go before peerDigestPDFinish */
785 
786  if (pdcb_valid) {
787  fetch->pd->flags.requested = false;
788  fetch->pd->req_result = reason;
789  }
790 
791  /* schedule next check if peer is still out there */
792  if (pcb_valid) {
793  PeerDigest *pd = fetch->pd;
794 
795  if (err) {
798  } else {
799  pd->times.retry_delay = 0;
801  }
802  }
803 
804  /* note: order is significant */
805  if (fcb_valid)
807 
808  if (pdcb_valid)
809  peerDigestPDFinish(fetch, pcb_valid, err);
810 
811  if (fcb_valid)
812  peerDigestFetchFinish(fetch, err);
813 }
814 
815 /* destroys digest if peer disappeared
816  * must be called only when fetch and pd cbdata are valid */
817 static void
818 peerDigestPDFinish(DigestFetchState * fetch, int pcb_valid, int err)
819 {
820  PeerDigest *pd = fetch->pd;
821  const auto host = pd->host;
823  pd->times.req_delay = fetch->resp_time;
824  pd->stats.sent.kbytes += fetch->sent.bytes;
825  pd->stats.recv.kbytes += fetch->recv.bytes;
826  pd->stats.sent.msgs += fetch->sent.msg;
827  pd->stats.recv.msgs += fetch->recv.msg;
828 
829  if (err) {
830  debugs(72, DBG_IMPORTANT, "" << (pcb_valid ? "temporary " : "" ) << "disabling (" << pd->req_result << ") digest from " << host);
831 
832  delete pd->cd;
833  pd->cd = nullptr;
834 
835  pd->flags.usable = false;
836 
837  if (!pcb_valid)
839  } else {
840  assert(pcb_valid);
841 
842  pd->flags.usable = true;
843 
844  /* XXX: ugly condition, but how? */
845 
846  if (fetch->entry->store_status == STORE_OK)
847  debugs(72, 2, "re-used old digest from " << host);
848  else
849  debugs(72, 2, "received valid digest from " << host);
850  }
851 
852  cbdataReferenceDone(fetch->pd);
853 }
854 
855 /* free fetch state structures
856  * must be called only when fetch cbdata is valid */
857 static void
859 {
860  assert(fetch->entry && fetch->request);
861 
862  if (fetch->old_entry) {
863  debugs(72, 3, "peerDigestFetchFinish: deleting old entry");
864  storeUnregister(fetch->old_sc, fetch->old_entry, fetch);
865  fetch->old_entry->releaseRequest();
866  fetch->old_entry->unlock("peerDigestFetchFinish old");
867  fetch->old_entry = NULL;
868  }
869 
870  /* update global stats */
871  statCounter.cd.kbytes_sent += fetch->sent.bytes;
872  statCounter.cd.kbytes_recv += fetch->recv.bytes;
873  statCounter.cd.msgs_sent += fetch->sent.msg;
874  statCounter.cd.msgs_recv += fetch->recv.msg;
875 
876  delete fetch;
877 }
878 
879 /* calculate fetch stats after completion */
880 static void
882 {
883  MemObject *mem;
884  assert(fetch->entry && fetch->request);
885 
886  mem = fetch->entry->mem_obj;
887  assert(mem);
888 
889  /* XXX: outgoing numbers are not precise */
890  /* XXX: we must distinguish between 304 hits and misses here */
891  fetch->sent.bytes = fetch->request->prefixLen();
892  /* XXX: this is slightly wrong: we don't KNOW that the entire memobject
893  * was fetched. We only know how big it is
894  */
895  fetch->recv.bytes = mem->size();
896  fetch->sent.msg = fetch->recv.msg = 1;
897  fetch->expires = fetch->entry->expires;
898  fetch->resp_time = squid_curtime - fetch->start_time;
899 
900  debugs(72, 3, "peerDigestFetchFinish: recv " << fetch->recv.bytes <<
901  " bytes in " << (int) fetch->resp_time << " secs");
902 
903  debugs(72, 3, "peerDigestFetchFinish: expires: " <<
904  (long int) fetch->expires << " (" << std::showpos <<
905  (int) (fetch->expires - squid_curtime) << "), lmt: " <<
906  std::noshowpos << (long int) fetch->entry->lastModified() << " (" <<
907  std::showpos << (int) (fetch->entry->lastModified() - squid_curtime) <<
908  ")");
909 
910 }
911 
912 static int
913 peerDigestSetCBlock(PeerDigest * pd, const char *buf)
914 {
915  StoreDigestCBlock cblock;
916  int freed_size = 0;
917  const auto host = pd->host;
918 
919  memcpy(&cblock, buf, sizeof(cblock));
920  /* network -> host conversions */
921  cblock.ver.current = ntohs(cblock.ver.current);
922  cblock.ver.required = ntohs(cblock.ver.required);
923  cblock.capacity = ntohl(cblock.capacity);
924  cblock.count = ntohl(cblock.count);
925  cblock.del_count = ntohl(cblock.del_count);
926  cblock.mask_size = ntohl(cblock.mask_size);
927  debugs(72, 2, "got digest cblock from " << host << "; ver: " <<
928  (int) cblock.ver.current << " (req: " << (int) cblock.ver.required <<
929  ")");
930 
931  debugs(72, 2, "\t size: " <<
932  cblock.mask_size << " bytes, e-cnt: " <<
933  cblock.count << ", e-util: " <<
934  xpercentInt(cblock.count, cblock.capacity) << "%" );
935  /* check version requirements (both ways) */
936 
937  if (cblock.ver.required > CacheDigestVer.current) {
938  debugs(72, DBG_IMPORTANT, "" << host << " digest requires version " <<
939  cblock.ver.required << "; have: " << CacheDigestVer.current);
940 
941  return 0;
942  }
943 
944  if (cblock.ver.current < CacheDigestVer.required) {
945  debugs(72, DBG_IMPORTANT, "" << host << " digest is version " <<
946  cblock.ver.current << "; we require: " <<
948 
949  return 0;
950  }
951 
952  /* check consistency */
953  if (cblock.ver.required > cblock.ver.current ||
954  cblock.mask_size <= 0 || cblock.capacity <= 0 ||
955  cblock.bits_per_entry <= 0 || cblock.hash_func_count <= 0) {
956  debugs(72, DBG_CRITICAL, "" << host << " digest cblock is corrupted.");
957  return 0;
958  }
959 
960  /* check consistency further */
961  if ((size_t)cblock.mask_size != CacheDigest::CalcMaskSize(cblock.capacity, cblock.bits_per_entry)) {
962  debugs(72, DBG_CRITICAL, host << " digest cblock is corrupted " <<
963  "(mask size mismatch: " << cblock.mask_size << " ? " <<
965  << ").");
966  return 0;
967  }
968 
969  /* there are some things we cannot do yet */
971  debugs(72, DBG_CRITICAL, "" << host << " digest: unsupported #hash functions: " <<
972  cblock.hash_func_count << " ? " << CacheDigestHashFuncCount << ".");
973  return 0;
974  }
975 
976  /*
977  * no cblock bugs below this point
978  */
979  /* check size changes */
980  if (pd->cd && cblock.mask_size != (ssize_t)pd->cd->mask_size) {
981  debugs(72, 2, host << " digest changed size: " << cblock.mask_size <<
982  " -> " << pd->cd->mask_size);
983  freed_size = pd->cd->mask_size;
984  delete pd->cd;
985  pd->cd = nullptr;
986  }
987 
988  if (!pd->cd) {
989  debugs(72, 2, "creating " << host << " digest; size: " << cblock.mask_size << " (" <<
990  std::showpos << (int) (cblock.mask_size - freed_size) << ") bytes");
991  pd->cd = new CacheDigest(cblock.capacity, cblock.bits_per_entry);
992 
993  if (cblock.mask_size >= freed_size)
994  statCounter.cd.memory += (cblock.mask_size - freed_size);
995  }
996 
997  assert(pd->cd);
998  /* these assignments leave us in an inconsistent state until we finish reading the digest */
999  pd->cd->count = cblock.count;
1000  pd->cd->del_count = cblock.del_count;
1001  return 1;
1002 }
1003 
1004 static int
1006 {
1007  /* TODO: we should calculate the prob of a false hit instead of bit util */
1008  const auto bit_util = pd->cd->usedMaskPercent();
1009 
1010  if (bit_util > 65.0) {
1011  debugs(72, DBG_CRITICAL, "Warning: " << pd->host <<
1012  " peer digest has too many bits on (" << bit_util << "%).");
1013  return 0;
1014  }
1015 
1016  return 1;
1017 }
1018 
1019 static int
1020 saneDiff(time_t diff)
1021 {
1022  return abs((int) diff) > squid_curtime / 2 ? 0 : diff;
1023 }
1024 
1025 void
1027 {
1028 #define f2s(flag) (pd->flags.flag ? "yes" : "no")
1029 #define appendTime(tm) storeAppendPrintf(e, "%s\t %10ld\t %+d\t %+d\n", \
1030  ""#tm, (long int)pd->times.tm, \
1031  saneDiff(pd->times.tm - squid_curtime), \
1032  saneDiff(pd->times.tm - pd->times.initialized))
1033 
1034  assert(pd);
1035 
1036  auto host = pd->host;
1037  storeAppendPrintf(e, "\npeer digest from " SQUIDSBUFPH "\n", SQUIDSBUFPRINT(host));
1038 
1039  cacheDigestGuessStatsReport(&pd->stats.guess, e, host);
1040 
1041  storeAppendPrintf(e, "\nevent\t timestamp\t secs from now\t secs from init\n");
1042  appendTime(initialized);
1043  appendTime(needed);
1044  appendTime(requested);
1045  appendTime(received);
1046  appendTime(next_check);
1047 
1048  storeAppendPrintf(e, "peer digest state:\n");
1049  storeAppendPrintf(e, "\tneeded: %3s, usable: %3s, requested: %3s\n",
1050  f2s(needed), f2s(usable), f2s(requested));
1051  storeAppendPrintf(e, "\n\tlast retry delay: %d secs\n",
1052  (int) pd->times.retry_delay);
1053  storeAppendPrintf(e, "\tlast request response time: %d secs\n",
1054  (int) pd->times.req_delay);
1055  storeAppendPrintf(e, "\tlast request result: %s\n",
1056  pd->req_result ? pd->req_result : "(none)");
1057 
1058  storeAppendPrintf(e, "\npeer digest traffic:\n");
1059  storeAppendPrintf(e, "\trequests sent: %d, volume: %d KB\n",
1060  pd->stats.sent.msgs, (int) pd->stats.sent.kbytes.kb);
1061  storeAppendPrintf(e, "\treplies recv: %d, volume: %d KB\n",
1062  pd->stats.recv.msgs, (int) pd->stats.recv.kbytes.kb);
1063 
1064  storeAppendPrintf(e, "\npeer digest structure:\n");
1065 
1066  if (pd->cd)
1067  cacheDigestReport(pd->cd, host, e);
1068  else
1069  storeAppendPrintf(e, "\tno in-memory copy\n");
1070 }
1071 
1072 #endif
1073 
bool usable
Definition: PeerDigest.h:89
unsigned char bits_per_entry
Definition: PeerDigest.h:34
void fatal(const char *message)
Definition: fatal.cc:28
double usedMaskPercent() const
percentage of mask bits which are used
Definition: CacheDigest.cc:183
static EVH peerDigestCheck
Definition: peer_digest.cc:38
static void peerDigestFetchAbort(DigestFetchState *fetch, char *buf, const char *reason)
Definition: peer_digest.cc:769
#define SM_PAGE_SIZE
Definition: defines.h:65
PeerDigest * digest
Definition: CachePeer.h:142
static int peerDigestFetchReply(void *, char *, ssize_t)
Definition: peer_digest.cc:499
void userInfo(const SBuf &s)
Definition: Uri.h:79
int peerDigestSwapInHeaders(void *, char *, ssize_t)
Definition: peer_digest.cc:583
#define StoreDigestCBlockSize
Definition: peer_digest.cc:58
AnyP::Uri url
the request URI
Definition: HttpRequest.h:115
bool needed
Definition: PeerDigest.h:88
void ensureMemObject(const char *storeId, const char *logUri, const HttpRequestMethod &aMethod)
initialize mem_obj (if needed) and set URIs/method (if missing)
Definition: store.cc:1615
@ DIGEST_READ_NONE
Definition: enums.h:203
void peerDigestCreate(CachePeer *p)
Definition: peer_digest.cc:130
#define appendTime(tm)
void releaseRequest(const bool shareable=false)
Definition: store.cc:473
time_t req_delay
Definition: PeerDigest.h:100
digest_read_state_t state
Definition: PeerDigest.h:71
digest_read_state_t
Definition: enums.h:202
#define cbdataReferenceValidDone(var, ptr)
Definition: cbdata.h:256
@ scNone
Definition: StatusCode.h:21
HttpHeader header
Definition: Message.h:75
struct PeerDigest::@90::@91 sent
StoreEntry * entry
Definition: PeerDigest.h:53
MemObject * mem_obj
Definition: Store.h:222
RequestFlags flags
Definition: HttpRequest.h:141
int peerDigestSwapInMask(void *, char *, ssize_t)
Definition: peer_digest.cc:660
static int saneDiff(time_t diff)
ByteCounter memory
Definition: StatCounters.h:105
@ KEY_PRIVATE
Definition: enums.h:102
CacheDigest * cd
Definition: PeerDigest.h:83
MemObject & mem()
Definition: Store.h:52
time_t next_check
Definition: PeerDigest.h:97
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:872
void lock(const char *context)
Definition: store.cc:460
char * login
Definition: CachePeer.h:174
bool requested
Definition: PeerDigest.h:90
int64_t offset
Definition: StoreIOBuffer.h:55
Definition: SBuf.h:87
#define xstrdup
store_client * old_sc
Definition: PeerDigest.h:56
time_t start_time
Definition: PeerDigest.h:60
uint16_t flags
Definition: Store.h:233
int cbdataReferenceValid(const void *p)
Definition: cbdata.cc:398
void cacheDigestGuessStatsReport(const CacheDigestGuessStats *stats, StoreEntry *sentry, const SBuf &label)
Definition: CacheDigest.cc:209
static void peerDigestFetchSetStats(DigestFetchState *fetch)
Definition: peer_digest.cc:881
Http::StatusLine sline
Definition: HttpReply.h:56
time_t expires
Definition: Store.h:227
void HTTPMSGUNLOCK(M *&a)
Definition: Message.h:150
#define DBG_CRITICAL
Definition: Debug.h:40
static int peerDigestSetCBlock(PeerDigest *pd, const char *buf)
Definition: peer_digest.cc:913
SBuf host
copy of peer->host
Definition: PeerDigest.h:84
#define cbdataReference(var)
Definition: cbdata.h:341
#define DBG_IMPORTANT
Definition: Debug.h:41
uint32_t mask_offset
Definition: PeerDigest.h:59
StoreEntry * storeGetPublicByRequest(HttpRequest *req, const KeyScope keyScope)
Definition: store.cc:531
static const time_t GlobDigestReqMinGap
Definition: peer_digest.cc:63
void peerDigestNeeded(PeerDigest *pd)
Definition: peer_digest.cc:177
StoreEntry * old_entry
Definition: PeerDigest.h:54
ByteCounter kbytes_sent
Definition: StatCounters.h:76
void peerDigestStatsReport(const PeerDigest *pd, StoreEntry *e)
@ ENTRY_ABORTED
Definition: enums.h:115
static STCB peerDigestHandleReply
Definition: peer_digest.cc:40
store_client * sc
Definition: PeerDigest.h:55
static const time_t PeerDigestReqMinGap
Definition: peer_digest.cc:61
@ initCacheDigest
Cache Digest fetching code.
const char * StoreDigestFileName
@ DIGEST_READ_DONE
Definition: enums.h:208
char * internalRemoteUri(bool encrypt, const char *host, unsigned short port, const char *dir, const SBuf &name)
Definition: internal.cc:87
int size
Definition: ModDevPoll.cc:77
struct PeerDigest::@90::@91 recv
#define NULL
Definition: types.h:166
void cacheDigestReport(CacheDigest *cd, const SBuf &label, StoreEntry *e)
Definition: CacheDigest.cc:245
#define SQUIDSBUFPRINT(s)
Definition: SBuf.h:32
static int peerDigestFetchedEnough(DigestFetchState *fetch, char *buf, ssize_t size, const char *step_name)
Definition: peer_digest.cc:694
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:123
short int required
Definition: PeerDigest.h:21
Http::StatusCode status() const
retrieve the status code for this status line
Definition: StatusLine.h:45
struct PeerDigest::@89 times
static void peerDigestFetchStop(DigestFetchState *fetch, char *buf, const char *reason)
Definition: peer_digest.cc:760
time_t resp_time
Definition: PeerDigest.h:61
@ DIGEST_READ_HEADERS
Definition: enums.h:205
#define EBIT_TEST(flag, bit)
Definition: defines.h:69
int unlock(const char *context)
Definition: store.cc:484
#define safe_free(x)
Definition: xalloc.h:73
store_status_t store_status
Definition: Store.h:245
time_t retry_delay
Definition: PeerDigest.h:98
static void peerDigestFetchFinish(DigestFetchState *fetch, int err)
Definition: peer_digest.cc:858
#define assert(EX)
Definition: assert.h:19
static uint32_t CalcMaskSize(uint64_t cap, uint8_t bpe)
Definition: CacheDigest.cc:273
const char * StoreDigestMimeStr
Version const CacheDigestVer
Definition: peer_digest.cc:56
static time_t peerDigestIncDelay(const PeerDigest *pd)
Definition: peer_digest.cc:190
char * mask
Definition: CacheDigest.h:58
struct DigestFetchState::@87 sent
void HTTPMSGLOCK(Http::Message *a)
Definition: Message.h:161
int64_t size() const
Definition: MemObject.cc:234
#define cbdataReferenceDone(var)
Definition: cbdata.h:350
CachePeer * peer
Definition: PeerDigest.h:82
uint64_t del_count
Definition: CacheDigest.h:56
@ DIGEST_READ_CBLOCK
Definition: enums.h:206
static int sc[16]
Definition: smbdes.c:121
struct PeerDigest::@90 stats
#define CBDATA_CLASS_INIT(type)
Definition: cbdata.h:318
static void peerDigestReqFinish(DigestFetchState *fetch, char *buf, int, int, int, const char *reason, int err)
Definition: peer_digest.cc:778
int prefixLen() const
Definition: HttpRequest.cc:370
static void peerDigestPDFinish(DigestFetchState *fetch, int pcb_valid, int err)
Definition: peer_digest.cc:818
@ STORE_OK
Definition: enums.h:50
time_t squid_curtime
Definition: stub_time.cc:17
int peerDigestSwapInCBlock(void *, char *, ssize_t)
Definition: peer_digest.cc:622
PeerDigest(CachePeer *)
Definition: peer_digest.cc:69
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
Definition: store.cc:774
static void peerDigestDestroy(PeerDigest *pd)
Definition: peer_digest.cc:149
#define f2s(flag)
@ scNotModified
Definition: StatusCode.h:40
void EVH(void *)
Definition: event.h:18
static void peerDigestRequest(PeerDigest *pd)
Definition: peer_digest.cc:291
static void peerDigestSetCheck(PeerDigest *pd, time_t delay)
Definition: peer_digest.cc:213
HttpRequest * request
Definition: PeerDigest.h:57
HttpRequestMethod method
Definition: HttpRequest.h:114
char * host
Definition: CachePeer.h:40
short int current
Definition: PeerDigest.h:20
char buf[SM_PAGE_SIZE]
Definition: PeerDigest.h:69
static time_t pd_last_req_time
Definition: peer_digest.cc:67
void updateOnNotModified(StoreEntry *old, StoreEntry &e304)
using a 304 response, update the old entry (metadata and reply headers)
Definition: Controller.cc:732
struct PeerDigest::@88 flags
void putStr(Http::HdrType id, const char *str)
Definition: HttpHeader.cc:1067
const char * req_result
Definition: PeerDigest.h:85
static HttpRequest * FromUrlXXX(const char *url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
Definition: HttpRequest.cc:529
CacheDigestGuessStats guess
Definition: PeerDigest.h:106
@ DIGEST_READ_MASK
Definition: enums.h:207
const HttpReply & freshestReply() const
Definition: MemObject.h:67
unsigned char hash_func_count
Definition: PeerDigest.h:35
DigestFetchState(PeerDigest *, HttpRequest *)
Definition: peer_digest.cc:89
static time_t peerDigestNewDelay(const StoreEntry *e)
Definition: peer_digest.cc:201
time_t received
Definition: PeerDigest.h:101
@ DIGEST_READ_REPLY
Definition: enums.h:204
static void fwdStart(const Comm::ConnectionPointer &client, StoreEntry *, HttpRequest *)
Same as Start() but no master xaction info (AccessLogEntry) available.
Definition: FwdState.cc:438
bool encryptTransport
whether transport encryption (TLS/SSL) is to be used on connections to the peer
Definition: PeerOptions.h:145
void lastModified(const time_t when)
Definition: Store.h:177
uint32_t mask_size
Definition: CacheDigest.h:59
@ scOkay
Definition: StatusCode.h:26
PeerDigest * pd
Definition: PeerDigest.h:52
uint64_t count
Definition: CacheDigest.h:55
void peerDigestNotePeerGone(PeerDigest *pd)
Definition: peer_digest.cc:224
int storeUnregister(store_client *sc, StoreEntry *e, void *data)
size_t headersEnd(const char *mime, size_t l, bool &containsObsFold)
Definition: mime_header.cc:18
Security::PeerOptions secure
security settings for peer connection
Definition: CachePeer.h:190
void storeClientCopy(store_client *sc, StoreEntry *e, StoreIOBuffer copyInto, STCB *callback, void *data)
static int peerDigestUseful(const PeerDigest *pd)
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291
SQUIDCEXTERN int xpercentInt(double part, double whole)
Definition: util.c:60
ByteCounter kbytes_recv
Definition: StatCounters.h:79
HttpRequestPointer request
Definition: MemObject.h:188
int CacheDigestHashFuncCount
unsigned short http_port
Definition: CachePeer.h:77
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:109
void STCB(void *, StoreIOBuffer)
Definition: StoreClient.h:18
#define SQUIDSBUFPH
Definition: SBuf.h:31
struct DigestFetchState::@87 recv
store_client * storeClientListAdd(StoreEntry *e, void *data)
struct StatCounters::@134 cd
ssize_t bufofs
Definition: PeerDigest.h:70
StatCounters statCounter
Definition: StatCounters.cc:12
char * digest_url
Definition: CachePeer.h:143
Controller & Root()
safely access controller singleton
Definition: Controller.cc:945

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors