}
void
-HttpBody::packInto(Packer * p) const
+HttpBody::packInto(Packable * p) const
{
assert(p);
#define HTTPBODY_H_
#include "MemBuf.h"
-class Packer;
/** Representation of a short predetermined message
*
* by the HttpBody.
*/
void setMb(MemBuf *);
- /** output the HttpBody contents into the supplied packer
+
+ /** output the HttpBody contents into the supplied container
*
* \note content is not cleared by the output operation
*/
- void packInto(Packer *) const;
+ void packInto(Packable *) const;
/// clear the HttpBody content
void clear();
}
void
-HttpHdrCc::packInto(Packer * p) const
+HttpHdrCc::packInto(Packable * p) const
{
// optimization: if the mask is empty do nothing
if (mask==0)
#include "mem/forward.h"
#include "SquidString.h"
-class Packer;
+class Packable;
/** Http Cache-Control header representation
*
/// check whether the attribute value supplied by id is set
_SQUID_INLINE_ bool isSet(http_hdr_cc_type id) const;
- void packInto(Packer * p) const;
+ void packInto(Packable * p) const;
/** bit-mask representing what header values are set among those
* recognized by squid.
}
static void
-httpHdrRangeRespSpecPackInto(const HttpHdrRangeSpec * spec, Packer * p)
+httpHdrRangeRespSpecPackInto(const HttpHdrRangeSpec * spec, Packable * p)
{
/* Ensure typecast is safe */
assert (spec->length >= 0);
}
void
-httpHdrContRangePackInto(const HttpHdrContRange * range, Packer * p)
+httpHdrContRangePackInto(const HttpHdrContRange * range, Packable * p)
{
assert(range && p);
httpHdrRangeRespSpecPackInto(&range->spec, p);
int httpHdrContRangeParseInit(HttpHdrContRange * crange, const char *crange_spec);
void httpHdrContRangeDestroy(HttpHdrContRange * crange);
HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange);
-void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packer * p);
+void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packable * p);
/** inits with given spec */
void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, int64_t);
void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t);
}
void
-HttpHdrRangeSpec::packInto(Packer * packer) const
+HttpHdrRangeSpec::packInto(Packable * packer) const
{
if (!known_spec(offset)) /* suffix */
packer->Printf("-%" PRId64, length);
}
void
-HttpHdrRange::packInto(Packer * packer) const
+HttpHdrRange::packInto(Packable * packer) const
{
const_iterator pos = begin();
}
void
-HttpHdrScTarget::packInto(Packer * p) const
+HttpHdrScTarget::packInto(Packable * p) const
{
http_hdr_sc_type flag;
int pcount = 0;
}
void
-HttpHdrSc::packInto(Packer * p) const
+HttpHdrSc::packInto(Packable * p) const
{
dlink_node *node;
assert(p);
~HttpHdrSc();
bool parse(const String *str);
- void packInto(Packer * p) const;
+ void packInto(Packable * p) const;
void updateStats(StatHist *) const;
HttpHdrScTarget * getMergedTarget (const char *ourtarget); //todo: make const?
void setMaxAge(char const *target, int max_age);
#include "SquidString.h"
#include "typedefs.h"
+class Packable;
class StatHist;
-class Packer;
class StoreEntry;
/** Representation of HTTP Surogate-Control header field targeted directive
String Target() const { return target; }
void mergeWith(const HttpHdrScTarget * new_sc);
- void packInto (Packer *p) const;
+ void packInto(Packable *p) const;
void updateStats(StatHist *) const;
private:
/* packs all the entries using supplied packer */
void
-HttpHeader::packInto(Packer * p, bool mask_sensitive_info) const
+HttpHeader::packInto(Packable * p, bool mask_sensitive_info) const
{
HttpHeaderPos pos = HttpHeaderInitPos;
const HttpHeaderEntry *e;
}
void
-HttpHeaderEntry::packInto(Packer * p) const
+HttpHeaderEntry::packInto(Packable * p) const
{
assert(p);
p->append(name.rawBuf(), name.size());
class HttpHdrContRange;
class HttpHdrRange;
class HttpHdrSc;
-class Packer;
+class Packable;
class StoreEntry;
class SBuf;
~HttpHeaderEntry();
static HttpHeaderEntry *parse(const char *field_start, const char *field_end);
HttpHeaderEntry *clone() const;
- void packInto(Packer *p) const;
+ void packInto(Packable *p) const;
int getInt() const;
int64_t getInt64() const;
void compact();
int reset();
int parse(const char *header_start, size_t len);
- void packInto(Packer * p, bool mask_sensitive_info=false) const;
+ void packInto(Packable * p, bool mask_sensitive_info=false) const;
HttpHeaderEntry *getEntry(HttpHeaderPos * pos) const;
HttpHeaderEntry *findEntry(http_hdr_type id) const;
int delByName(const char *name);
bool parseInit(const char *field, int flen);
int canonize(int64_t clen);
void outputInfo( char const *note) const;
- void packInto(Packer * p) const;
+ void packInto(Packable * p) const;
bool mergeWith(const HttpHdrRangeSpec * donor);
int64_t offset;
int64_t length;
int canonize(HttpReply *rep);
/* returns true if ranges are valid; inits HttpHdrRange */
bool parseInit(const String * range_spec);
- void packInto(Packer * p) const;
+ void packInto(Packable * p) const;
/* other */
bool isComplex() const;
bool willBeComplex() const;
}
}
-void HttpMsg::packInto(Packer *p, bool full_uri) const
+void HttpMsg::packInto(Packable *p, bool full_uri) const
{
packFirstLineInto(p, full_uri);
header.packInto(p);
virtual void reset() = 0; // will have body when http*Clean()s are gone
- void packInto(Packer * p, bool full_uri) const;
+ void packInto(Packable * p, bool full_uri) const;
///< produce a message copy, except for a few connection-specific settings
virtual HttpMsg *clone() const = 0; ///< \todo rename: not a true copy?
*/
virtual bool sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, Http::StatusCode *error) = 0;
- virtual void packFirstLineInto(Packer * p, bool full_uri) const = 0;
+ virtual void packFirstLineInto(Packable * p, bool full_uri) const = 0;
virtual bool parseFirstLine(const char *blk_start, const char *blk_end) = 0;
}
void
-HttpReply::packHeadersInto(Packer * p) const
+HttpReply::packHeadersInto(Packable * p) const
{
sline.packInto(p);
header.packInto(p);
}
void
-HttpReply::packInto(Packer * p)
+HttpReply::packInto(Packable * p)
{
packHeadersInto(p);
body.packInto(p);
int validatorsMatch (HttpReply const *other) const;
- void packHeadersInto(Packer * p) const;
+ void packHeadersInto(Packable * p) const;
/** Clone this reply.
* Could be done as a copy-contructor but we do not want to accidently copy a HttpReply..
void hdrCacheClean();
- void packInto(Packer * p);
+ void packInto(Packable * p);
/* ez-routines */
/** \return construct 304 reply and pack it into a MemBuf */
mutable int64_t bodySizeMax; /**< cached result of calcMaxBodySize */
protected:
- virtual void packFirstLineInto(Packer * p, bool) const { sline.packInto(p); }
+ virtual void packFirstLineInto(Packable * p, bool) const { sline.packInto(p); }
virtual bool parseFirstLine(const char *start, const char *end);
};
/* packs request-line and headers, appends <crlf> terminator */
void
-HttpRequest::pack(Packer * p)
+HttpRequest::pack(Packable * p)
{
assert(p);
/* pack request-line */
* A wrapper for debugObj()
*/
void
-httpRequestPack(void *obj, Packer *p)
+httpRequestPack(void *obj, Packable *p)
{
HttpRequest *request = static_cast<HttpRequest*>(obj);
request->pack(p);
return "/";
}
-void HttpRequest::packFirstLineInto(Packer * p, bool full_uri) const
+void HttpRequest::packFirstLineInto(Packable * p, bool full_uri) const
{
// form HTTP request-line
p->Printf(SQUIDSBUFPH " %s HTTP/%d.%d\r\n",
class ConnStateData;
/* Http Request */
-void httpRequestPack(void *obj, Packer *p);
+void httpRequestPack(void *obj, Packable *p);
class HttpHdrRange;
void swapOut(StoreEntry * e);
- void pack(Packer * p);
+ void pack(Packable * p);
- static void httpRequestPack(void *obj, Packer *p);
+ static void httpRequestPack(void *obj, Packable *p);
static HttpRequest * CreateFromUrlAndMethod(char * url, const HttpRequestMethod& method);
mutable int64_t rangeOffsetLimit; /* caches the result of getRangeOffsetLimit */
protected:
- virtual void packFirstLineInto(Packer * p, bool full_uri) const;
+ virtual void packFirstLineInto(Packable * p, bool full_uri) const;
virtual bool sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, Http::StatusCode *error);
}
void
-Http::StatusLine::packInto(Packer * p) const
+Http::StatusLine::packInto(Packable * p) const
{
assert(p);
#include "http/StatusCode.h"
#include "SquidString.h"
-class Packer;
+class Packable;
class String;
namespace Http
const char *reason() const;
/// pack fields using Packer
- void packInto(Packer * p) const;
+ void packInto(Packable * p) const;
/**
* Parse a buffer and fill internal structures;
STUB_NOP
HttpReply::~HttpReply() STUB
void HttpReply::setHeaders(Http::StatusCode status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires_) STUB
- void HttpReply::packHeadersInto(Packer * p) const STUB
+ void HttpReply::packHeadersInto(Packable *) const STUB
void HttpReply::reset() STUB
- void httpBodyPackInto(const HttpBody * body, Packer * p) STUB
+ void httpBodyPackInto(const HttpBody *, Packable *) STUB
bool HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, Http::StatusCode *error) STUB_RETVAL(false)
int HttpReply::httpMsgParseError() STUB_RETVAL(0)
bool HttpReply::expectingBody(const HttpRequestMethod&, int64_t&) const STUB_RETVAL(false)
HttpRequest::HttpRequest() : HttpMsg(hoRequest) STUB
HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aUrlpath) : HttpMsg(hoRequest) STUB
HttpRequest::~HttpRequest() STUB
- void HttpRequest::packFirstLineInto(Packer * p, bool full_uri) const STUB
+ void HttpRequest::packFirstLineInto(Packable *, bool) const STUB
bool HttpRequest::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, Http::StatusCode *error) STUB_RETVAL(false)
void HttpRequest::hdrCacheInit() STUB
void HttpRequest::reset() STUB