return STRE_NEWLINE;
}
-/* case insensitive compare that the parsed string matches the
- given string. Returns non-zero on match. */
+#ifndef WITHOUT_LIBCURL
+/* case insensitive compare that the parsed string matches the given string.
+ Returns non-zero on match. */
int curlx_str_casecompare(struct Curl_str *str, const char *check)
{
size_t clen = check ? strlen(check) : 0;
return ((str->len == clen) && strncasecompare(str->str, check, clen));
}
+#endif
/* case sensitive string compare. Returns non-zero on match. */
int curlx_str_cmp(struct Curl_str *str, const char *check)
if(ENABLE_SERVER_DEBUG)
set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
endif()
+ set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "WITHOUT_LIBCURL")
# Test servers simply are standalone programs that do not use libcurl
# library. For convenience and to ease portability of these servers,
# some source code files from the libcurl subdirectory are also used
endif
endif
+AM_CPPFLAGS += -DWITHOUT_LIBCURL
+
# Makefile.inc provides neat definitions
include Makefile.inc
CURLX_SRCS = \
../../lib/curlx/nonblock.c \
../../lib/curlx/strparse.c \
- ../../lib/strequal.c \
../../lib/curlx/warnless.c \
../../lib/curlx/timediff.c \
../../lib/curlx/timeval.c \
- ../../lib/strcase.c \
../../lib/curlx/multibyte.c \
../../lib/curlx/version_win32.c
../../lib/curlx/curlx.h \
../../lib/curl_ctype.h \
../../lib/curlx/nonblock.h \
- ../../lib/strcase.h \
../../lib/curlx/warnless.h \
../../lib/curlx/timediff.h \
../../lib/curlx/timeval.h \
- ../../lib/strcase.h \
../../lib/curlx/multibyte.h \
../../lib/curlx/version_win32.h
if(got_exit_signal)
return 1; /* done */
- if((req->cl == 0) && curl_strnequal("Content-Length:", line, 15)) {
+ if((req->cl == 0) && !CURL_STRNICMP("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
logmsg("... but will abort after %zu bytes", req->cl);
break;
}
- else if(curl_strnequal("Transfer-Encoding: chunked", line,
- strlen("Transfer-Encoding: chunked"))) {
+ else if(!CURL_STRNICMP("Transfer-Encoding: chunked", line,
+ strlen("Transfer-Encoding: chunked"))) {
/* chunked data coming in */
chunked = TRUE;
}
if(got_exit_signal)
return 1; /* done */
- if((req->cl == 0) && curl_strnequal("Content-Length:", line, 15)) {
+ if((req->cl == 0) && !CURL_STRNICMP("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
if(req->skip)
logmsg("... but will abort after %zu bytes", req->cl);
}
- else if(curl_strnequal("Transfer-Encoding: chunked", line,
- strlen("Transfer-Encoding: chunked"))) {
+ else if(!CURL_STRNICMP("Transfer-Encoding: chunked", line,
+ strlen("Transfer-Encoding: chunked"))) {
/* chunked data coming in */
chunked = TRUE;
}
- else if(req->noexpect &&
- curl_strnequal("Expect: 100-continue", line,
- strlen("Expect: 100-continue"))) {
+ else if(req->noexpect && !CURL_STRNICMP("Expect: 100-continue", line,
+ strlen("Expect: 100-continue"))) {
if(req->cl)
req->cl = 0;
req->skipall = TRUE;
# endif
#endif
+#ifdef _WIN32
+# define CURL_STRNICMP(p1, p2, n) _strnicmp(p1, p2, n)
+#elif defined(HAVE_STRCASECMP)
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+# define CURL_STRNICMP(p1, p2, n) strncasecmp(p1, p2, n)
+#elif defined(HAVE_STRCMPI)
+# define CURL_STRNICMP(p1, p2, n) strncmpi(p1, p2, n)
+#elif defined(HAVE_STRICMP)
+# define CURL_STRNICMP(p1, p2, n) strnicmp(p1, p2, n)
+#else
+# error "missing case insensitive comparison function"
+#endif
+
enum {
DOCNUMBER_NOTHING = -7,
DOCNUMBER_QUIT = -6,