httpHeaderMaskInit(&mask, 0);
}
-HttpHeader::HttpHeader(http_hdr_owner_type const &anOwner) : owner (anOwner), len (0)
+HttpHeader::HttpHeader(const http_hdr_owner_type anOwner): owner(anOwner), len(0)
{
assert(anOwner > hoNone && anOwner <= hoReply);
debugs(55, 7, "init-ing hdr: " << this << " owner: " << owner);
httpHeaderMaskInit(&mask, 0);
}
+HttpHeader::HttpHeader(const HttpHeader &other): owner(other.owner), len(other.len)
+{
+ httpHeaderMaskInit(&mask, 0);
+ update(&other, NULL); // will update the mask as well
+}
+
HttpHeader::~HttpHeader()
{
clean();
}
-const HttpHeader &
+HttpHeader &
HttpHeader::operator =(const HttpHeader &other)
{
if (this != &other) {
public:
HttpHeader();
- HttpHeader(http_hdr_owner_type const &owner);
+ explicit HttpHeader(const http_hdr_owner_type owner);
+ HttpHeader(const HttpHeader &other);
~HttpHeader();
- const HttpHeader &operator =(const HttpHeader &other);
+ HttpHeader &operator =(const HttpHeader &other);
/* Interface functions */
void clean();
private:
HttpHeaderEntry *findLastEntry(http_hdr_type id) const;
- /// Made it non-copyable. Our destructor is a bit nasty...
- HttpHeader(const HttpHeader &);
};