HttpBody.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 56 HTTP Message Body */
10 
11 #include "squid.h"
12 #include "HttpBody.h"
13 #include "MemBuf.h"
14 
16 {}
17 
19 {
20  delete mb;
21 }
22 
23 void
25 {
26  mb->clean();
27 }
28 
29 /* set body by absorbing mb */
30 void
32 {
33  delete mb;
34  /* note: protection against assign-to-self is not needed
35  * as MemBuf doesn't have a copy-constructor. If such a constructor
36  * is ever added, add such protection here.
37  */
38  mb = mb_; /* absorb */
39 }
40 
41 void
43 {
44  assert(p);
45 
46  if (mb->contentSize())
47  p->append(mb->content(), mb->contentSize());
48 }
49 
~HttpBody()
Definition: HttpBody.cc:18
#define assert(EX)
Definition: assert.h:17
MemBuf * mb
Definition: HttpBody.h:51
void packInto(Packable *) const
Definition: HttpBody.cc:42
char * p
Definition: membanger.c:43
HttpBody()
Definition: HttpBody.cc:15
virtual void append(const char *buf, int size)=0
Appends a c-string to existing packed data.
char * content()
start of the added data
Definition: MemBuf.h:41
void clear()
clear the HttpBody content
Definition: HttpBody.cc:24
mb_size_t contentSize() const
available data size
Definition: MemBuf.h:47
void clean()
Definition: MemBuf.cc:122
void setMb(MemBuf *)
Definition: HttpBody.cc:31
Definition: MemBuf.h:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors