From 850754432a8a0e924cefd1c162b515a3ff9c7c9e Mon Sep 17 00:00:00 2001 From: snowdrop Date: Fri, 14 May 2004 09:31:48 +0000 Subject: timeout is explicitly set before each select() call --- nanohttp/nanohttp-server.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'nanohttp/nanohttp-server.c') diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index bbd741f..23c71d9 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-server.c,v 1.5 2004/03/26 13:37:57 snowdrop Exp $ + * $Id: nanohttp-server.c,v 1.6 2004/05/14 09:31:48 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -376,10 +376,11 @@ int httpd_run() FD_ZERO(&fds); FD_SET(_httpd_socket, &fds); - select(1, &fds, NULL, NULL, &timeout); - - while (_httpd_run && (FD_ISSET(_httpd_socket, &fds))) + { + timeout.tv_sec = 1; + timeout.tv_usec = 0; select(1, &fds, NULL, NULL, &timeout); + } while (_httpd_run && (FD_ISSET(_httpd_socket, &fds))) if (!_httpd_run) break; -- cgit v1.1-32-gdbae