aboutsummaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-10-07 22:57:24 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-10-07 22:57:24 +0000
commita6d4d3eeac8c6e0e8def305f3b6bcab43361a210 (patch)
tree8a7029d76c7be6b62f1e73a4d8167e4f9501d181 /tests/server
parent62f97f1817379f448ce069add864bbd9f93806a1 (diff)
use curlx_strnequal() from the private lib sources instead of strncasecmp()
for maximum portability
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/Makefile.am3
-rw-r--r--tests/server/sws.c10
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am
index 39280a8a7..a655e3f63 100644
--- a/tests/server/Makefile.am
+++ b/tests/server/Makefile.am
@@ -31,6 +31,7 @@ INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/include
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
+
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 9922b09ce..db2979175 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -55,6 +55,7 @@
#include <netdb.h>
#endif
+#include "curlx.h" /* from the private lib dir */
#include "getpart.h"
#ifndef FALSE
@@ -70,9 +71,6 @@
#include <process.h>
#define sleep(sec) Sleep ((sec)*1000)
-#ifdef _MSC_VER
-#define strncasecmp strnicmp
-#endif
#define EINPROGRESS WSAEINPROGRESS
#define EWOULDBLOCK WSAEWOULDBLOCK
@@ -371,7 +369,7 @@ int ProcessRequest(struct httprequest *req)
*/
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
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
@@ -381,8 +379,8 @@ int ProcessRequest(struct httprequest *req)
logmsg("Found Content-Legth: %d in the request", req->cl);
break;
}
- else if(!strncasecmp("Transfer-Encoding: chunked", line,
- strlen("Transfer-Encoding: chunked"))) {
+ else if(curlx_strnequal("Transfer-Encoding: chunked", line,
+ strlen("Transfer-Encoding: chunked"))) {
/* chunked data coming in */
chunked = TRUE;
}