/*
- * $Id: HttpHeader.cc,v 1.26 1998/03/20 18:06:38 rousskov Exp $
+ * $Id: HttpHeader.cc,v 1.27 1998/03/31 09:03:45 rousskov Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
{"Content-Range", HDR_CONTENT_RANGE, ftPContRange},
{"Content-Type", HDR_CONTENT_TYPE, ftStr},
{"Date", HDR_DATE, ftDate_1123},
- {"Etag", HDR_ETAG, ftStr}, /* for now */
+ {"ETag", HDR_ETAG, ftStr}, /* for now */
{"Expires", HDR_EXPIRES, ftDate_1123},
{"Host", HDR_HOST, ftStr},
{"If-Modified-Since", HDR_IMS, ftDate_1123},
HttpHeaderEntry *e_clone;
HttpHeaderPos pos = HttpHeaderInitPos;
assert(old && fresh);
+ assert(old != fresh);
debug(55, 7) ("updating hdr: %p <- %p\n", old, fresh);
while ((e = httpHeaderGetEntry(fresh, &pos))) {
httpHeaderMaskInit(&hdr->mask); /* temporal inconsistency */
debug(55, 7) ("deleting '%s' fields in hdr %p\n", name, hdr);
while ((e = httpHeaderGetEntry(hdr, &pos))) {
- if (!strCmp(e->name, name)) {
+ if (!strCaseCmp(e->name, name)) {
httpHeaderDelAt(hdr, pos);
count++;
} else
stringClean(&e->value);
assert(Headers[e->id].stat.aliveCount);
Headers[e->id].stat.aliveCount--;
+ e->id = -1;
memFree(MEM_HTTP_HDR_ENTRY, e);
}
#define strChr(s,ch) ((const char*)strchr(strBuf(s), (ch)))
#define strRChr(s,ch) ((const char*)strrchr(strBuf(s), (ch)))
#define strStr(s,str) ((const char*)strstr(strBuf(s), (str)))
-#define strCmp(s,str) strcmp(strBuf(s), (str))
+#define strCmp(s,str) strcmp(strBuf(s), (str))
+#define strCaseCmp(s,str) strcasecmp(strBuf(s), (str))
#define strSet(s,ptr,ch) (s).buf[ptr-(s).buf] = (ch)
#define strCut(s,pos) (s).buf[pos] = '\0'
/* #define strCat(s,str) stringAppend(&(s), (str), strlen(str)+1) */