From: rousskov <> Date: Tue, 31 Mar 1998 16:03:45 +0000 (+0000) Subject: - HttpHeader now uses case-insensitive string cmp in DelByName(). X-Git-Tag: SQUID_3_0_PRE1~3678 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1934cc674b1b02047b14bbcce20f28f7b198be91;p=thirdparty%2Fsquid.git - HttpHeader now uses case-insensitive string cmp in DelByName(). --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 593d5ac968..8ec8d4422b 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -96,7 +96,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] = {"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}, @@ -281,6 +281,7 @@ httpHeaderUpdate(HttpHeader *old, const HttpHeader *fresh) 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))) { @@ -401,7 +402,7 @@ httpHeaderDelByName(HttpHeader * hdr, const char *name) 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 @@ -678,6 +679,7 @@ httpHeaderEntryDestroy(HttpHeaderEntry * e) stringClean(&e->value); assert(Headers[e->id].stat.aliveCount); Headers[e->id].stat.aliveCount--; + e->id = -1; memFree(MEM_HTTP_HDR_ENTRY, e); } diff --git a/src/protos.h b/src/protos.h index e977a43152..798fddef50 100644 --- a/src/protos.h +++ b/src/protos.h @@ -867,7 +867,8 @@ void htcpSocketClose(void); #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) */