diff options
author | mrcsys | 2006-02-21 16:40:47 +0000 |
---|---|---|
committer | mrcsys | 2006-02-21 16:40:47 +0000 |
commit | 2110d12371587e3238615623f81ddd0adc7a4f7c (patch) | |
tree | 0dcf46ea4ab561cc03c4639cdf70816de739cea6 /nanohttp | |
parent | 5f34925e6f130a5184527fc057dd5e962fe29687 (diff) | |
download | csoap-2110d12371587e3238615623f81ddd0adc7a4f7c.tar.gz csoap-2110d12371587e3238615623f81ddd0adc7a4f7c.tar.bz2 |
fixed a win32 compat issue
Diffstat (limited to 'nanohttp')
-rw-r--r-- | nanohttp/nanohttp-server.c | 14 | ||||
-rw-r--r-- | nanohttp/nanohttp-socket.c | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index 19d741a..c885a72 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-server.c,v 1.49 2006/02/18 20:14:36 snowdrop Exp $ +* $Id: nanohttp-server.c,v 1.50 2006/02/21 16:40:47 mrcsys Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -491,9 +491,15 @@ static int httpd_decode_authorization(const char *value, char **user, char **pas unsigned char *tmp, *tmp2; tmp = malloc(strlen(value) * 2); +#ifdef WIN32 + memset(tmp, 0, strlen(value)*2); + value = strstr(value, ' '); +#else bzero(tmp, strlen(value) * 2); - value = index(value, ' '); +#endif + + value++; log_debug2("Authorization (base64) = \"%s\"", value); @@ -501,7 +507,11 @@ static int httpd_decode_authorization(const char *value, char **user, char **pas log_debug2("Authorization (ascii) = \"%s\"", tmp); +#ifdef WIN32 + tmp2 = strstr(tmp, ':'); +#else tmp2 = index(tmp, ':'); +#endif *tmp2++ = '\0'; *pass = strdup(tmp2); diff --git a/nanohttp/nanohttp-socket.c b/nanohttp/nanohttp-socket.c index 8a41806..86315d9 100644 --- a/nanohttp/nanohttp-socket.c +++ b/nanohttp/nanohttp-socket.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-socket.c,v 1.50 2006/02/21 16:14:51 mrcsys Exp $ +* $Id: nanohttp-socket.c,v 1.51 2006/02/21 16:41:13 mrcsys Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -136,7 +136,11 @@ hsocket_init(hsocket_t * sock) { log_verbose1("Starting hsocket init"); +#ifdef WIN32 + memset(sock, 0, sizeof(hsocket_t)); +#else bzero(sock, sizeof(hsocket_t)); +#endif sock->sock = -1; return H_OK; |