/*
- * $Id: HttpHeader.cc,v 1.112 2006/04/22 05:29:18 robertc Exp $
+ * $Id: HttpHeader.cc,v 1.113 2006/05/05 18:16:26 wessels Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
return -1;
}
+/*
+ * This is copied from Squid-2 code, which uses squid_off_t instead
+ * of int, and ftSize instead of ftInt
+ */
+int
+httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id)
+{
+ HttpHeaderEntry *e;
+ int value = -1;
+ int ok;
+ assert_eid(id);
+ assert(Headers[id].type == ftInt); /* must be of an appropriate type */
+
+ if ((e = httpHeaderFindEntry(hdr, id))) {
+ ok = httpHeaderParseSize(e->value.buf(), &value);
+ httpHeaderNoteParsedEntry(e->id, e->value, !ok);
+ }
+
+ return value;
+}
+
time_t
httpHeaderGetTime(const HttpHeader * hdr, http_hdr_type id)
{
/*
- * $Id: HttpMsg.cc,v 1.26 2006/04/18 12:25:50 robertc Exp $
+ * $Id: HttpMsg.cc,v 1.27 2006/05/05 18:16:26 wessels Exp $
*
* DEBUG: section 74 HTTP Message
* AUTHOR: Alex Rousskov
void HttpMsg::hdrCacheInit()
{
- content_length = httpHeaderGetInt(&header, HDR_CONTENT_LENGTH);
+ content_length = httpHeaderGetSize(&header, HDR_CONTENT_LENGTH);
assert(NULL == cache_control);
cache_control = httpHeaderGetCc(&header);
}
/*
- * $Id: protos.h,v 1.524 2006/04/29 13:53:16 serassio Exp $
+ * $Id: protos.h,v 1.525 2006/05/05 18:16:26 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
SQUIDCEXTERN void httpHeaderPutRange(HttpHeader * hdr, const HttpHdrRange * range);
SQUIDCEXTERN void httpHeaderPutExt(HttpHeader * hdr, const char *name, const char *value);
SQUIDCEXTERN int httpHeaderGetInt(const HttpHeader * hdr, http_hdr_type id);
+SQUIDCEXTERN int httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id);
SQUIDCEXTERN time_t httpHeaderGetTime(const HttpHeader * hdr, http_hdr_type id);
SQUIDCEXTERN TimeOrTag httpHeaderGetTimeOrTag(const HttpHeader * hdr, http_hdr_type id);
SQUIDCEXTERN HttpHdrCc *httpHeaderGetCc(const HttpHeader * hdr);