use curlx_strnequal() from the private lib sources instead of strncasecmp()

for maximum portability
This commit is contained in:
Daniel Stenberg
2004-10-07 22:57:24 +00:00
parent 62f97f1817
commit a6d4d3eeac
2 changed files with 6 additions and 7 deletions

View File

@@ -31,6 +31,7 @@ INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/include
noinst_PROGRAMS = sws noinst_PROGRAMS = sws
sws_SOURCES= sws.c getpart.c getpart.h sws_SOURCES= sws.c getpart.c getpart.h $(top_srcdir)/lib/strequal.c
extra_DIST = config.h.in extra_DIST = config.h.in

View File

@@ -55,6 +55,7 @@
#include <netdb.h> #include <netdb.h>
#endif #endif
#include "curlx.h" /* from the private lib dir */
#include "getpart.h" #include "getpart.h"
#ifndef FALSE #ifndef FALSE
@@ -70,9 +71,6 @@
#include <process.h> #include <process.h>
#define sleep(sec) Sleep ((sec)*1000) #define sleep(sec) Sleep ((sec)*1000)
#ifdef _MSC_VER
#define strncasecmp strnicmp
#endif
#define EINPROGRESS WSAEINPROGRESS #define EINPROGRESS WSAEINPROGRESS
#define EWOULDBLOCK WSAEWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK
@@ -371,7 +369,7 @@ int ProcessRequest(struct httprequest *req)
*/ */
do { do {
if(!req->cl && !strncasecmp("Content-Length:", line, 15)) { if(!req->cl && curlx_strnequal("Content-Length:", line, 15)) {
/* If we don't ignore content-length, we read it and we read the whole /* If we don't ignore content-length, we read it and we read the whole
request including the body before we return. If we've been told to request including the body before we return. If we've been told to
ignore the content-length, we will return as soon as all headers ignore the content-length, we will return as soon as all headers
@@ -381,8 +379,8 @@ int ProcessRequest(struct httprequest *req)
logmsg("Found Content-Legth: %d in the request", req->cl); logmsg("Found Content-Legth: %d in the request", req->cl);
break; break;
} }
else if(!strncasecmp("Transfer-Encoding: chunked", line, else if(curlx_strnequal("Transfer-Encoding: chunked", line,
strlen("Transfer-Encoding: chunked"))) { strlen("Transfer-Encoding: chunked"))) {
/* chunked data coming in */ /* chunked data coming in */
chunked = TRUE; chunked = TRUE;
} }