/*
- * $Id: HttpHdrCc.cc,v 1.26 2003/03/09 12:29:40 robertc Exp $
+ * $Id: HttpHdrCc.cc,v 1.27 2005/04/23 14:49:41 serassio Exp $
*
* DEBUG: section 65 HTTP Cache Control Header
* AUTHOR: Alex Rousskov
const char *pos = NULL;
http_hdr_cc_type type;
int ilen;
+ int nlen;
assert(cc && str);
/* iterate through comma separated list */
while (strListGetItem(str, ',', &item, &ilen, &pos)) {
- /* strip '=' statements @?@ */
+ /* isolate directive name */
- if ((p = strchr(item, '=')) && (p - item < ilen))
- ilen = p++ - item;
+ if ((p = (const char *)memchr(item, '=', ilen)) && (p - item < ilen))
+ nlen = p++ - item;
+ else
+ nlen = ilen;
/* find type */
- type = (http_hdr_cc_type ) httpHeaderIdByName(item, ilen,
+ type = (http_hdr_cc_type ) httpHeaderIdByName(item, nlen,
CcFieldsInfo, CC_ENUM_END);
if (type < 0) {
break;
+ case CC_OTHER:
+
+ if (cc->other.size())
+ cc->other.append(", ");
+
+ cc->other.append(item, ilen);
+
+ break;
+
default:
- /* note that we ignore most of '=' specs */
+ /* note that we ignore most of '=' specs (RFCVIOLATION) */
break;
}
}
httpHdrCcDestroy(HttpHdrCc * cc)
{
assert(cc);
+
+ if (cc->other.buf())
+ cc->other.clean();
+
memFree(cc, MEM_HTTP_HDR_CC);
}
pcount++;
}
}
+
+ if (cc->other.size())
+ packerPrintf(p, (pcount ? ", %s" : "%s"), cc->other.buf());
}
void
/*
- * $Id: structs.h,v 1.516 2005/04/18 21:52:43 hno Exp $
+ * $Id: structs.h,v 1.517 2005/04/23 14:49:41 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
int max_age;
int s_maxage;
int max_stale;
+ String other;
};
/* some fields can hold either time or etag specs (e.g. If-Range) */