From 5a1bc610819a75e9332a302aa69a4b47ae03d45c Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 8 Apr 1998 05:51:36 +0000 Subject: [PATCH] Didnt compile because request->urlpath is a String. Added gross strNCmp() macro --- src/client_side.cc | 6 +++--- src/protos.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client_side.cc b/src/client_side.cc index 73d95c5ff9..a361a4ea92 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.260 1998/04/07 23:40:34 rousskov Exp $ + * $Id: client_side.cc,v 1.261 1998/04/07 23:51:36 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1857,8 +1857,8 @@ clientReadRequest(int fd, void *data) break; } if (0 == http->internal) - if (0 == strncmp(request->urlpath, "/squid-internal/", 16)) - if (0 == strcasecmp(request->host, getMyHostname()) + if (0 == strNCmp(request->urlpath, "/squid-internal/", 16)) + if (0 == strcasecmp(request->host, getMyHostname())) if (request->port == Config.Port.http->i) http->internal = 1; safe_free(http->log_uri); diff --git a/src/protos.h b/src/protos.h index f12327b140..80932fcddc 100644 --- a/src/protos.h +++ b/src/protos.h @@ -880,6 +880,7 @@ void htcpSocketClose(void); #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 strNCmp(s,str,n) strncmp(strBuf(s), (str), (n)) #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' -- 2.47.3