diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2011-09-19 20:55:30 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-11-09 20:10:03 +0100 |
commit | 747c48162c983eca0c97767bef1803cf09675935 (patch) | |
tree | 1cf832a61f3c06357e177627d47cda1d08ab86e7 /src | |
parent | e2e80f0890ec52ad7856850761bff0840bbb65b4 (diff) | |
download | pianobar-747c48162c983eca0c97767bef1803cf09675935.tar.gz pianobar-747c48162c983eca0c97767bef1803cf09675935.tar.bz2 pianobar-747c48162c983eca0c97767bef1803cf09675935.zip |
waitress: header keys/values are case-insensitive
Diffstat (limited to 'src')
-rw-r--r-- | src/libwaitress/waitress.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c index 1c2456f..705d8dc 100644 --- a/src/libwaitress/waitress.c +++ b/src/libwaitress/waitress.c @@ -43,7 +43,7 @@ THE SOFTWARE. #include "config.h" #include "waitress.h" -#define streq(a,b) (strcmp(a,b) == 0) +#define strcaseeq(a,b) (strcasecmp(a,b) == 0) #define WAITRESS_HTTP_VERSION "1.1" typedef struct { @@ -568,10 +568,10 @@ static WaitressHandlerReturn_t WaitressHandleChunked (WaitressHandle_t *waith, */ static void WaitressHandleHeader (WaitressHandle_t *waith, const char * const key, const char * const value) { - if (streq (key, "Content-Length")) { + if (strcaseeq (key, "Content-Length")) { waith->request.contentLength = atol (value); - } else if (streq (key, "Transfer-Encoding")) { - if (streq (value, "chunked")) { + } else if (strcaseeq (key, "Transfer-Encoding")) { + if (strcaseeq (value, "chunked")) { waith->request.dataHandler = WaitressHandleChunked; } } @@ -925,6 +925,8 @@ const char *WaitressErrorToStr (WaitressReturn_t wRet) { #include <string.h> #include "waitress.h" +#define streq(a,b) (strcmp(a,b) == 0) + /* string equality test (memory location or content) */ static bool streqtest (const char *x, const char *y) { |