diff options
author | snowdrop | 2004-08-30 15:26:48 +0000 |
---|---|---|
committer | snowdrop | 2004-08-30 15:26:48 +0000 |
commit | 30911b1730a1a69241beaca7d1ed71212d4f7b3f (patch) | |
tree | 1538c363a546cc7584f88b3886433d43aca50c77 /nanohttp/nanohttp-server.c | |
parent | 056647348ff38f83b5e13bed1c4f4bb76cce50f9 (diff) | |
download | csoap-30911b1730a1a69241beaca7d1ed71212d4f7b3f.tar.gz csoap-30911b1730a1a69241beaca7d1ed71212d4f7b3f.tar.bz2 |
migration win32 socket code
Diffstat (limited to 'nanohttp/nanohttp-server.c')
-rw-r--r-- | nanohttp/nanohttp-server.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index 0e241a7..642699b 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-server.c,v 1.10 2004/08/30 13:25:23 snowdrop Exp $ +* $Id: nanohttp-server.c,v 1.11 2004/08/30 15:26:53 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -68,11 +68,17 @@ static int _httpd_run = 1; static int _httpd_terminate_signal = SIGTERM; /* ----------------------------------------------------- -FUNCTION: httpd_init +FUNCTION: httpd_init
+NOTE: This will be called from soap_server_init_args() ----------------------------------------------------- */ int httpd_init(int argc, char *argv[]) { int i, status; +
+ status = hsocket_module_init();
+ if (status != 0)
+ return status;
+
/* write argument information */ log_verbose1("Arguments:"); @@ -356,11 +362,8 @@ int httpd_run() struct timeval timeout; -#ifndef WIN32 -#if HSOCKET_BLOCKMODE!=0 -#endif -#else - unsigned long iMode=HSOCKET_BLOCKMODE; +#ifdef WIN32 + unsigned long iMode=HSOCKET_NONBLOCKMODE; #endif pthread_attr_init(&attr); @@ -386,10 +389,12 @@ pthread_attr_init(&attr); #ifndef WIN32 -#if HSOCKET_BLOCKMODE!=0 +/* Try always non block mode
+#if HSOCKET_BLOCKMODE!=0*/ fcntl(_httpd_socket, F_SETFL, O_NONBLOCK); -#endif +/*#endif*/ #else
+ iMode = HSOCKET_NONBLOCKMODE;
if(ioctlsocket(_httpd_socket, FIONBIO, (u_long FAR*) &iMode) == INVALID_SOCKET) { log_error1("ioctlsocket error"); |