From a106abc6f551cc29bf71dffd74c658688eaf0e6f Mon Sep 17 00:00:00 2001 From: mrcsys Date: Wed, 31 May 2006 19:39:34 +0000 Subject: added a helper function to determine how many nanohttp connections are active --- nanohttp/nanohttp-server.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'nanohttp/nanohttp-server.c') diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index 090b9d4..4995723 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-server.c,v 1.60 2006/05/19 14:49:17 m0gg Exp $ +* $Id: nanohttp-server.c,v 1.61 2006/05/31 19:39:34 mrcsys Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -321,6 +321,27 @@ httpd_get_protocol(void) return hssl_enabled()? "https" : "http"; } +/*-------------------------------------------------- +FUNCTION: httpd_get_conncount +----------------------------------------------------*/ +int +httpd_get_conncount(void) +{ + int i; + int c=0; + + for (i = 0;i<_httpd_max_connections; i++) + { + + if (_httpd_connection[i].flag == CONNECTION_IN_USE) + { + c++; + } + } + + return c; +} + /* * ----------------------------------------------------- * FUNCTION: httpd_services -- cgit v1.1-32-gdbae