From f7bc3f4ac5affd8587d37f71bd2a23ea085b03b4 Mon Sep 17 00:00:00 2001 From: snowdrop Date: Tue, 18 May 2004 16:37:21 +0000 Subject: Added command line argument support for "-NHTTPtsig " by adding _http_terminate_signal variable. This defines the termination signal handler value. Example : ./myserver -NHTTPtsig 2 will shutdown nano http properly by pressing ctrl-c (SIGINT = 2). --- nanohttp/nanohttp-server.c | 12 +++++++----- nanohttp/nanohttp-server.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index 23c71d9..a752fda 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-server.c,v 1.6 2004/05/14 09:31:48 snowdrop Exp $ + * $Id: nanohttp-server.c,v 1.7 2004/05/18 16:37:21 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -58,7 +58,7 @@ static hsocket_t _httpd_socket; static hservice_t *_httpd_services_head = NULL; static hservice_t *_httpd_services_tail = NULL; static int _httpd_run = 1; - +static int _httpd_terminate_signal = SIGTERM; /* ----------------------------------------------------- FUNCTION: httpd_init @@ -76,6 +76,8 @@ int httpd_init(int argc, char *argv[]) for (i=0;i