HttpReply.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2018 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 58 HTTP Reply (Response) */
10 
11 #include "squid.h"
12 #include "acl/AclSizeLimit.h"
13 #include "acl/FilledChecklist.h"
14 #include "base/EnumIterator.h"
15 #include "globals.h"
17 #include "HttpBody.h"
18 #include "HttpHdrCc.h"
19 #include "HttpHdrContRange.h"
20 #include "HttpHdrSc.h"
21 #include "HttpReply.h"
22 #include "HttpRequest.h"
23 #include "MemBuf.h"
24 #include "SquidConfig.h"
25 #include "SquidTime.h"
26 #include "Store.h"
27 #include "StrList.h"
28 
30  Http::Message(hoReply),
31  date(0),
32  last_modified(0),
33  expires(0),
34  surrogate_control(nullptr),
35  keep_alive(0),
36  protoPrefix("HTTP/"),
37  bodySizeMax(-2),
38  content_range(nullptr)
39 {
40  init();
41 }
42 
44 {
45  if (do_clean)
46  clean();
47 }
48 
49 void
51 {
52  hdrCacheInit();
53  sline.init();
55  do_clean = true;
56 }
57 
59 {
60 
61  // reset should not reset the protocol; could have made protoPrefix a
62  // virtual function instead, but it is not clear whether virtual methods
63  // are allowed with MEMPROXY_CLASS() and whether some cbdata void*
64  // conversions are not going to kill virtual tables
65  const String pfx = protoPrefix;
66  clean();
67  init();
68  protoPrefix = pfx;
69 }
70 
71 void
73 {
74  // we used to assert that the pipe is NULL, but now the message only
75  // points to a pipe that is owned and initiated by another object.
76  body_pipe = NULL;
77 
78  body.clear();
79  hdrCacheClean();
80  header.clean();
81  sline.clean();
82  bodySizeMax = -2; // hack: make calculatedBodySizeMax() false
83 }
84 
85 void
87 {
88  sline.packInto(&p);
89  header.packInto(&p);
90  p.append("\r\n", 2);
91 }
92 
93 void
95 {
96  MemBuf buf;
97  buf.init();
99  p.append(buf.content(), buf.contentSize());
100 }
101 
102 void
104 {
106  body.packInto(&buf);
107 }
108 
109 /* create memBuf, create mem-based packer, pack, destroy packer, return MemBuf */
110 MemBuf *
112 {
113  MemBuf *mb = new MemBuf;
114  mb->init();
115  packInto(*mb);
116  return mb;
117 }
118 
119 HttpReply *
121 {
123 
124  HttpReply *rv = new HttpReply;
125  int t;
126  HttpHeaderEntry *e;
127 
128  /* rv->content_length; */
129  rv->date = date;
131  rv->expires = expires;
133  /* rv->content_range */
134  /* rv->keep_alive */
136 
137  for (t = 0; ImsEntries[t] != Http::HdrType::OTHER; ++t) {
138  if ((e = header.findEntry(ImsEntries[t])))
139  rv->header.addEntry(e->clone());
140  }
141 
142  rv->putCc(cache_control);
143 
144  /* rv->body */
145  return rv;
146 }
147 
148 MemBuf *
150 {
151  /* Not as efficient as skipping the header duplication,
152  * but easier to maintain
153  */
154  HttpReply *temp = make304();
155  MemBuf *rv = temp->pack();
156  delete temp;
157  return rv;
158 }
159 
160 void
161 HttpReply::setHeaders(Http::StatusCode status, const char *reason,
162  const char *ctype, int64_t clen, time_t lmt, time_t expiresTime)
163 {
164  HttpHeader *hdr;
165  sline.set(Http::ProtocolVersion(), status, reason);
166  hdr = &header;
168  hdr->putStr(Http::HdrType::MIME_VERSION, "1.0");
170 
171  if (ctype) {
172  hdr->putStr(Http::HdrType::CONTENT_TYPE, ctype);
173  content_type = ctype;
174  } else
175  content_type = String();
176 
177  if (clen >= 0)
179 
180  if (expiresTime >= 0)
181  hdr->putTime(Http::HdrType::EXPIRES, expiresTime);
182 
183  if (lmt > 0) /* this used to be lmt != 0 @?@ */
185 
187 
188  content_length = clen;
189 
190  expires = expiresTime;
191 
192  last_modified = lmt;
193 }
194 
195 void
196 HttpReply::redirect(Http::StatusCode status, const char *loc)
197 {
198  HttpHeader *hdr;
199  sline.set(Http::ProtocolVersion(), status, NULL);
200  hdr = &header;
204  hdr->putStr(Http::HdrType::LOCATION, loc);
206  content_length = 0;
207 }
208 
209 /* compare the validators of two replies.
210  * 1 = they match
211  * 0 = they do not match
212  */
213 int
214 HttpReply::validatorsMatch(HttpReply const * otherRep) const
215 {
216  String one,two;
217  assert (otherRep);
218  /* Numbers first - easiest to check */
219  /* Content-Length */
220  /* TODO: remove -1 bypass */
221 
222  if (content_length != otherRep->content_length
223  && content_length > -1 &&
224  otherRep->content_length > -1)
225  return 0;
226 
227  /* ETag */
229 
230  two = otherRep->header.getStrOrList(Http::HdrType::ETAG);
231 
232  if (one.size()==0 || two.size()==0 || one.caseCmp(two)!=0 ) {
233  one.clean();
234  two.clean();
235  return 0;
236  }
237 
238  if (last_modified != otherRep->last_modified)
239  return 0;
240 
241  /* MD5 */
243 
245 
246  if (one.size()==0 || two.size()==0 || one.caseCmp(two)!=0 ) {
247  one.clean();
248  two.clean();
249  return 0;
250  }
251 
252  return 1;
253 }
254 
255 bool
257 {
258  assert(freshRep);
259 
260  /* update raw headers */
261  if (!header.update(&freshRep->header))
262  return false;
263 
264  /* clean cache */
265  hdrCacheClean();
266 
267  header.compact();
268  /* init cache */
269  hdrCacheInit();
270 
271  return true;
272 }
273 
274 /* internal routines */
275 
276 time_t
278 {
279  /* The s-maxage and max-age directive takes priority over Expires */
280 
281  if (cache_control) {
282  int maxAge = -1;
283  /*
284  * Conservatively handle the case when we have a max-age
285  * header, but no Date for reference?
286  */
287  if (cache_control->hasSMaxAge(&maxAge) || cache_control->hasMaxAge(&maxAge))
288  return (date >= 0) ? date + maxAge : squid_curtime;
289  }
290 
293  const time_t d = header.getTime(Http::HdrType::DATE);
294  const time_t e = header.getTime(Http::HdrType::EXPIRES);
295 
296  if (d == e)
297  return -1;
298  }
299 
301  const time_t e = header.getTime(Http::HdrType::EXPIRES);
302  /*
303  * HTTP/1.0 says that robust implementations should consider
304  * bad or malformed Expires header as equivalent to "expires
305  * immediately."
306  */
307  return e < 0 ? squid_curtime : e;
308  }
309 
310  return -1;
311 }
312 
313 /* sync this routine when you update HttpReply struct */
314 void
316 {
318 
325  header.getContRange() : nullptr;
326  keep_alive = persistent() ? 1 : 0;
327  const char *str = header.getStr(Http::HdrType::CONTENT_TYPE);
328 
329  if (str)
330  content_type.limitInit(str, strcspn(str, ";\t "));
331  else
332  content_type = String();
333 
334  /* be sure to set expires after date and cache-control */
336 }
337 
338 const HttpHdrContRange *
340 {
342  return content_range;
343 }
344 
345 /* sync this routine when you update HttpReply struct */
346 void
348 {
350 
351  if (cache_control) {
352  delete cache_control;
354  }
355 
356  if (surrogate_control) {
357  delete surrogate_control;
359  }
360 
361  if (content_range) {
362  delete content_range;
364  }
365 }
366 
367 /*
368  * Returns the body size of a HTTP response
369  */
370 int64_t
372 {
373  if (sline.version.major < 1)
374  return -1;
375  else if (method.id() == Http::METHOD_HEAD)
376  return 0;
377  else if (sline.status() == Http::scOkay)
378  (void) 0; /* common case, continue */
379  else if (sline.status() == Http::scNoContent)
380  return 0;
381  else if (sline.status() == Http::scNotModified)
382  return 0;
383  else if (sline.status() < Http::scOkay)
384  return 0;
385 
386  return content_length;
387 }
388 
395 bool
396 HttpReply::sanityCheckStartLine(const char *buf, const size_t hdr_len, Http::StatusCode *error)
397 {
398  // hack warning: using psize instead of size here due to type mismatches with MemBuf.
399 
400  // content is long enough to possibly hold a reply
401  // 4 being magic size of a 3-digit number plus space delimiter
402  if (hdr_len < (size_t)(protoPrefix.psize() + 4)) {
403  if (hdr_len > 0) {
404  debugs(58, 3, "Too small reply header (" << hdr_len << " bytes)");
405  *error = Http::scInvalidHeader;
406  }
407  return false;
408  }
409 
410  int pos;
411  // catch missing or mismatched protocol identifier
412  // allow special-case for ICY protocol (non-HTTP identifier) in response to faked HTTP request.
413  if (strncmp(buf, "ICY", 3) == 0) {
414  protoPrefix = "ICY";
415  pos = protoPrefix.psize();
416  } else {
417 
418  if (protoPrefix.cmp(buf, protoPrefix.size()) != 0) {
419  debugs(58, 3, "missing protocol prefix (" << protoPrefix << ") in '" << buf << "'");
420  *error = Http::scInvalidHeader;
421  return false;
422  }
423 
424  // catch missing or negative status value (negative '-' is not a digit)
425  pos = protoPrefix.psize();
426 
427  // skip arbitrary number of digits and a dot in the verion portion
428  while ((size_t)pos <= hdr_len && (*(buf+pos) == '.' || xisdigit(*(buf+pos)) ) ) ++pos;
429 
430  // catch missing version info
431  if (pos == protoPrefix.psize()) {
432  debugs(58, 3, "missing protocol version numbers (ie. " << protoPrefix << "/1.0) in '" << buf << "'");
433  *error = Http::scInvalidHeader;
434  return false;
435  }
436  }
437 
438  // skip arbitrary number of spaces...
439  while ((size_t)pos <= hdr_len && (char)*(buf+pos) == ' ') ++pos;
440 
441  if ((size_t)pos < hdr_len && !xisdigit(*(buf+pos))) {
442  debugs(58, 3, "missing or invalid status number in '" << buf << "'");
443  *error = Http::scInvalidHeader;
444  return false;
445  }
446 
447  return true;
448 }
449 
450 bool
451 HttpReply::parseFirstLine(const char *blk_start, const char *blk_end)
452 {
453  return sline.parse(protoPrefix, blk_start, blk_end);
454 }
455 
456 void
458 {
459  interpreter.applyStatusCodeRules(sline.status());
460 }
461 
462 bool
464 {
466  return Message::parseHeader(hp, clen);
467 }
468 
469 /* handy: resets and returns -1 */
470 int
472 {
473  int result(Http::Message::httpMsgParseError());
474  /* indicate an error in the status line */
476  return result;
477 }
478 
479 /*
480  * Indicate whether or not we would usually expect an entity-body
481  * along with this response
482  */
483 bool
484 HttpReply::expectingBody(const HttpRequestMethod& req_method, int64_t& theSize) const
485 {
486  bool expectBody = true;
487 
488  if (req_method == Http::METHOD_HEAD)
489  expectBody = false;
490  else if (sline.status() == Http::scNoContent)
491  expectBody = false;
492  else if (sline.status() == Http::scNotModified)
493  expectBody = false;
494  else if (sline.status() < Http::scOkay)
495  expectBody = false;
496  else
497  expectBody = true;
498 
499  if (expectBody) {
500  if (header.chunked())
501  theSize = -1;
502  else if (content_length >= 0)
503  theSize = content_length;
504  else
505  theSize = -1;
506  }
507 
508  return expectBody;
509 }
510 
511 bool
513 {
514  calcMaxBodySize(request);
515  debugs(58, 3, HERE << receivedSize << " >? " << bodySizeMax);
516  return bodySizeMax >= 0 && receivedSize > bodySizeMax;
517 }
518 
519 bool
521 {
522  calcMaxBodySize(request);
523  debugs(58, 7, HERE << "bodySizeMax=" << bodySizeMax);
524 
525  if (bodySizeMax < 0) // no body size limit
526  return false;
527 
528  int64_t expectedSize = -1;
529  if (!expectingBody(request.method, expectedSize))
530  return false;
531 
532  debugs(58, 6, HERE << expectedSize << " >? " << bodySizeMax);
533 
534  if (expectedSize < 0) // expecting body of an unknown length
535  return false;
536 
537  return expectedSize > bodySizeMax;
538 }
539 
540 void
542 {
543  // hack: -2 is used as "we have not calculated max body size yet" state
544  if (bodySizeMax != -2) // already tried
545  return;
546  bodySizeMax = -1;
547 
548  // short-circuit ACL testing if there are none configured
549  if (!Config.ReplyBodySize)
550  return;
551 
552  ACLFilledChecklist ch(NULL, &request, NULL);
553  // XXX: cont-cast becomes irrelevant when checklist is HttpReply::Pointer
554  ch.reply = const_cast<HttpReply *>(this);
555  HTTPMSGLOCK(ch.reply);
556  for (AclSizeLimit *l = Config.ReplyBodySize; l; l = l -> next) {
557  /* if there is no ACL list or if the ACLs listed match use this size value */
558  if (!l->aclList || ch.fastCheck(l->aclList).allowed()) {
559  debugs(58, 4, HERE << "bodySizeMax=" << bodySizeMax);
560  bodySizeMax = l->size; // may be -1
561  break;
562  }
563  }
564 }
565 
566 // XXX: check that this is sufficient for eCAP cloning
567 HttpReply *
569 {
570  HttpReply *rep = new HttpReply();
571  rep->sline = sline; // used in hdrCacheInit() call below
572  rep->header.append(&header);
573  rep->hdrCacheInit();
574  rep->hdr_sz = hdr_sz;
575  rep->http_ver = http_ver;
576  rep->pstate = pstate;
577  rep->body_pipe = body_pipe;
578 
579  // keep_alive is handled in hdrCacheInit()
580  return rep;
581 }
582 
583 bool
585 {
586  const HttpReply *aRep = dynamic_cast<const HttpReply*>(aMsg);
587  if (!aRep)
588  return false;
589  keep_alive = aRep->keep_alive;
590  sources = aRep->sources;
591  return true;
592 }
593 
595 {
596  String warning;
597  if (header.getList(Http::HdrType::WARNING, &warning)) {
598  const String newWarning = removeStaleWarningValues(warning);
599  if (warning.size() && warning.size() == newWarning.size())
600  return; // some warnings are there and none changed
602  if (newWarning.size()) { // some warnings left
603  HttpHeaderEntry *const e =
605  header.addEntry(e);
606  }
607  }
608 }
609 
615 {
616  String newValue;
617  const char *item = 0;
618  int len = 0;
619  const char *pos = 0;
620  while (strListGetItem(&value, ',', &item, &len, &pos)) {
621  bool keep = true;
622  // Does warning-value have warn-date (which contains quoted date)?
623  // We scan backwards, looking for two quoted strings.
624  // warning-value = warn-code SP warn-agent SP warn-text [SP warn-date]
625  const char *p = item + len - 1;
626 
627  while (p >= item && xisspace(*p)) --p; // skip whitespace
628 
629  // warning-value MUST end with quote
630  if (p >= item && *p == '"') {
631  const char *const warnDateEnd = p;
632  --p;
633  while (p >= item && *p != '"') --p; // find the next quote
634 
635  const char *warnDateBeg = p + 1;
636  --p;
637  while (p >= item && xisspace(*p)) --p; // skip whitespace
638 
639  if (p >= item && *p == '"' && warnDateBeg - p > 2) {
640  // found warn-text
641  String warnDate;
642  warnDate.append(warnDateBeg, warnDateEnd - warnDateBeg);
643  const time_t time = parse_rfc1123(warnDate.termedBuf());
644  keep = (time > 0 && time == date); // keep valid and matching date
645  }
646  }
647 
648  if (keep) {
649  if (newValue.size())
650  newValue.append(", ");
651  newValue.append(item, len);
652  }
653  }
654 
655  return newValue;
656 }
657 
658 bool
659 HttpReply::olderThan(const HttpReply *them) const
660 {
661  if (!them || !them->date || !date)
662  return false;
663  return date < them->date;
664 }
665 
666 void
670  debugs(58, 3, "Removing unexpected Content-Length header");
671 }
672 
int delById(Http::HdrType id)
Definition: HttpHeader.cc:681
AnyP::ProtocolVersion ProtocolVersion(unsigned int aMajor, unsigned int aMinor)
HTTP version label information.
int cmp(char const *) const
Definition: String.cc:269
int has(Http::HdrType id) const
Definition: HttpHeader.cc:1011
short int keep_alive
Definition: HttpReply.h:57
void clean()
reset this status-line back to Internal Server Error state
Definition: StatusLine.cc:23
void packInto(Packable *) const
pack fields into a Packable object
Definition: StatusLine.cc:46
int strListGetItem(const String *str, char del, const char **item, int *ilen, const char **pos)
Definition: StrList.cc:77
void limitInit(const char *str, int len)
Definition: String.cc:94
void calcMaxBodySize(HttpRequest &request) const
Definition: HttpReply.cc:541
#define assert(EX)
Definition: assert.h:17
int vary_ignore_expire
Definition: SquidConfig.h:314
time_t parse_rfc1123(const char *str)
Definition: rfc1123.c:159
int caseCmp(char const *) const
Definition: String.cc:299
HttpReply * make304() const
Definition: HttpReply.cc:120
void packInto(MemBuf &) const
Definition: HttpReply.cc:103
HttpHdrCc * cache_control
Definition: Message.h:76
ParseState pstate
the current parsing state
Definition: Message.h:94
void set(const AnyP::ProtocolVersion &newVersion, Http::StatusCode newStatus, const char *newReason=NULL)
Definition: StatusLine.cc:30
int hdr_sz
Definition: Message.h:81
Definition: SBuf.h:86
void applyStatusCodeRules(const StatusCode code)
prohibits Content-Length in 1xx and 204 responses
HttpRequestMethod method
Definition: HttpRequest.h:106
void packInto(Packable *) const
Definition: HttpBody.cc:42
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291
void error(char *format,...)
MemBuf * pack() const
Definition: HttpReply.cc:111
~HttpReply()
Definition: HttpReply.cc:43
bool expectedBodyTooLarge(HttpRequest &request)
Definition: HttpReply.cc:520
int64_t bodySize(const HttpRequestMethod &) const
Definition: HttpReply.cc:371
representation of a class of Size-limit ACLs
Definition: AclSizeLimit.h:16
void removeStaleWarnings()
Remove Warnings with warn-date different from Date value.
Definition: HttpReply.cc:594
void HTTPMSGLOCK(Http::Message *a)
Definition: Message.h:157
bool persistent() const
Definition: Message.cc:261
void hdrCacheClean()
Definition: HttpReply.cc:347
AnyP::ProtocolVersion http_ver
Definition: Message.h:72
#define xisspace(x)
Definition: xis.h:17
void redirect(Http::StatusCode, const char *)
Definition: HttpReply.cc:196
virtual void hdrCacheInit()
Definition: HttpReply.cc:315
char * p
Definition: membanger.c:43
String protoPrefix
Definition: HttpReply.h:64
int validatorsMatch(HttpReply const *other) const
Definition: HttpReply.cc:214
size_type size() const
Definition: SquidString.h:72
void clean()
Definition: HttpReply.cc:72
void append(char const *buf, int len)
Definition: String.cc:161
time_t squid_curtime
Definition: stub_time.cc:17
bool ProhibitsContentLength(const StatusCode sc)
whether this response status code prohibits sending Content-Length
Definition: StatusCode.h:94
virtual void append(const char *buf, int size)=0
Appends a c-string to existing packed data.
int psize() const
Definition: SquidString.h:76
virtual int httpMsgParseError()
Definition: HttpReply.cc:471
void init(mb_size_t szInit, mb_size_t szMax)
Definition: MemBuf.cc:96
MemBuf * packed304Reply() const
Definition: HttpReply.cc:149
virtual bool sanityCheckStartLine(const char *buf, const size_t hdr_len, Http::StatusCode *error)
Definition: HttpReply.cc:396
bool parseHeader(Http1::Parser &hp)
parses reply header using Parser
Definition: HttpReply.cc:463
const HttpHdrContRange * contentRange() const
Definition: HttpReply.cc:339
void append(const HttpHeader *src)
Definition: HttpHeader.cc:235
void init()
reset this status-line back to empty state
Definition: StatusLine.cc:17
unsigned int major
major version number
int64_t bodySizeMax
Definition: HttpReply.h:154
StatusCode
Definition: StatusCode.h:20
time_t hdrExpirationTime()
Definition: HttpReply.cc:277
int64_t content_length
Definition: Message.h:83
virtual bool expectingBody(const HttpRequestMethod &, int64_t &) const
Definition: HttpReply.cc:484
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:124
void setHeaders(Http::StatusCode status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires)
Definition: HttpReply.cc:161
bool updateOnNotModified(HttpReply const *other)
Definition: HttpReply.cc:256
String content_type
Definition: HttpReply.h:50
HttpHdrSc * getSc() const
Definition: HttpHeader.cc:1291
bool do_clean
Definition: HttpReply.h:66
void packHeadersUsingFastPacker(Packable &p) const
Definition: HttpReply.cc:86
HttpHeaderEntry * findEntry(Http::HdrType id) const
Definition: HttpHeader.cc:617
int64_t getInt64(Http::HdrType id) const
Definition: HttpHeader.cc:1182
void putTime(Http::HdrType id, time_t htime)
Definition: HttpHeader.cc:1063
time_t last_modified
Definition: HttpReply.h:46
char const * termedBuf() const
Definition: SquidString.h:91
String getList(Http::HdrType id) const
Definition: HttpHeader.cc:828
bool parse(const String &protoPrefix, const char *start, const char *end)
Definition: StatusLine.cc:75
common parts of HttpRequest and HttpReply
Definition: Message.h:24
bool allowed() const
Definition: Acl.h:141
AclSizeLimit * ReplyBodySize
Definition: SquidConfig.h:132
Http::StatusLine sline
Definition: HttpReply.h:60
virtual bool parseFirstLine(const char *start, const char *end)
Definition: HttpReply.cc:451
#define APP_FULLNAME
Definition: version.h:22
bool update(HttpHeader const *fresh)
Definition: HttpHeader.cc:283
time_t date
Definition: HttpReply.h:44
HttpHdrSc * surrogate_control
Definition: HttpReply.h:52
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
char * content()
start of the added data
Definition: MemBuf.h:41
void const char * buf
Definition: stub_helper.cc:16
std::ostream & HERE(std::ostream &s)
Definition: Debug.h:153
struct SquidConfig::@112 onoff
String getStrOrList(Http::HdrType id) const
Definition: HttpHeader.cc:862
void clear()
clear the HttpBody content
Definition: HttpBody.cc:24
mb_size_t contentSize() const
available data size
Definition: MemBuf.h:47
bool olderThan(const HttpReply *them) const
Definition: HttpReply.cc:659
HttpHeader header
Definition: Message.h:74
Http::MethodType id() const
Definition: RequestMethod.h:73
void packHeadersUsingSlowPacker(Packable &p) const
same as packHeadersUsingFastPacker() but assumes that p cannot quickly process small additions ...
Definition: HttpReply.cc:94
void putInt64(Http::HdrType id, int64_t number)
Definition: HttpHeader.cc:1054
void putCc(const HttpHdrCc *otherCc)
copies Cache-Control header to this message
Definition: Message.cc:34
allow_t const & fastCheck()
Definition: Checklist.cc:336
void putStr(Http::HdrType id, const char *str)
Definition: HttpHeader.cc:1072
bool hasMaxAge(int32_t *val=nullptr) const
Definition: HttpHdrCc.h:122
void clean()
Definition: HttpHeader.cc:187
HttpBody body
Definition: HttpReply.h:62
#define xisdigit(x)
Definition: xis.h:20
size_t HttpReply *STUB StoreEntry const KeyScope scope const HttpRequestMethod & method
Definition: stub_store.cc:122
void compact()
Definition: HttpHeader.cc:726
bool chunked() const
whether message uses chunked Transfer-Encoding
Definition: HttpHeader.h:188
Definition: MemBuf.h:23
void init()
Definition: HttpReply.cc:50
time_t getTime(Http::HdrType id) const
Definition: HttpHeader.cc:1195
void packInto(Packable *p, bool mask_sensitive_info=false) const
Definition: HttpHeader.cc:554
bool receivedBodyTooLarge(HttpRequest &, int64_t receivedBodySize)
Definition: HttpReply.cc:512
BodyPipe::Pointer body_pipe
optional pipeline to receive message body
Definition: Message.h:97
virtual void reset()
Definition: HttpReply.cc:58
virtual void hdrCacheInit()
Definition: Message.cc:286
const char * getStr(Http::HdrType id) const
Definition: HttpHeader.cc:1212
void clean()
Definition: String.cc:125
HttpHdrContRange * getContRange() const
Definition: HttpHeader.cc:1313
void addEntry(HttpHeaderEntry *e)
Definition: HttpHeader.cc:751
virtual int httpMsgParseError()
Definition: Message.cc:246
time_t expires
Definition: HttpReply.h:48
AnyP::ProtocolVersion version
breakdown of protocol version label: (HTTP/ICY) and (0.9/1.0/1.1)
Definition: StatusLine.h:70
void removeIrrelevantContentLength()
Some response status codes prohibit sending Content-Length (RFC 7230 section 3.3.2).
Definition: HttpReply.cc:667
virtual void configureContentLengthInterpreter(Http::ContentLengthInterpreter &)
configures the interpreter as needed
Definition: HttpReply.cc:457
HttpHdrContRange * content_range
parsed Content-Range; nil for non-206 responses!
Definition: HttpReply.h:156
char const * visible_appname_string
String removeStaleWarningValues(const String &value)
Definition: HttpReply.cc:614
class SquidConfig Config
Definition: SquidConfig.cc:12
bool hasSMaxAge(int32_t *val=nullptr) const
Definition: HttpHdrCc.h:127
#define NULL
Definition: types.h:166
uint32_t sources
The message sources.
Definition: Message.h:99
virtual bool inheritProperties(const Http::Message *)
Definition: HttpReply.cc:584
HttpHeaderEntry * clone() const
Definition: HttpHeader.cc:1519
Http::StatusCode status() const
retrieve the status code for this status line
Definition: StatusLine.h:45
HttpReply * clone() const
Definition: HttpReply.cc:568

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors