/*
- * $Id: Array.h,v 1.24 2005/11/21 22:43:41 wessels Exp $
+ * $Id: Array.h,v 1.25 2007/11/26 13:09:54 hno Exp $
*
* AUTHOR: Alex Rousskov
*
E &back();
E pop_back();
E shift(); // aka pop_front
+ void prune(E);
void preAppend(int app_count);
bool empty() const;
size_t size() const;
return items[size() - 1];
}
+template<class E>
+void
+Vector<E>::prune(E item)
+{
+ unsigned int n = 0;
+ for (unsigned int i = 0; i < count; i++) {
+ if (items[i] != item) {
+ if (i != n)
+ items[n] = items[i];
+ n++;
+ }
+ }
+
+ count = n;
+}
+
/* if you are going to append a known and large number of items, call this first */
template<class E>
void
/*
- * $Id: HttpHeader.cc,v 1.137 2007/11/26 12:31:37 hno Exp $
+ * $Id: HttpHeader.cc,v 1.138 2007/11/26 13:09:55 hno Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
++headers_deleted;
}
+/*
+ * Compacts the header storage
+ */
+void
+HttpHeader::compact()
+{
+ entries.prune(NULL);
+}
+
/*
* Refreshes the header mask. Required after delAt() calls.
*/
/*
- * $Id: HttpHeader.h,v 1.23 2007/08/13 17:20:51 hno Exp $
+ * $Id: HttpHeader.h,v 1.24 2007/11/26 13:09:55 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
void clean();
void append(const HttpHeader * src);
void update (HttpHeader const *fresh, HttpHeaderMask const *denied_mask);
+ void compact();
int reset();
int parse(const char *header_start, const char *header_end);
void packInto(Packer * p) const;
/*
- * $Id: HttpReply.cc,v 1.96 2007/08/13 17:20:51 hno Exp $
+ * $Id: HttpReply.cc,v 1.97 2007/11/26 13:09:55 hno Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
header.update(&freshRep->header,
(const HttpHeaderMask *) &Denied304HeadersMask);
+ header.compact();
/* init cache */
hdrCacheInit();
}