From 949a8d0b46d6baa9f42c2f8c3bd5e3bdc3596cbd Mon Sep 17 00:00:00 2001 From: m0gg Date: Sun, 19 Nov 2006 09:40:14 +0000 Subject: nanohttp admin patch; code cleanup --- nanohttp/nanohttp-server.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'nanohttp/nanohttp-server.h') diff --git a/nanohttp/nanohttp-server.h b/nanohttp/nanohttp-server.h index a5e1be1..f132285 100644 --- a/nanohttp/nanohttp-server.h +++ b/nanohttp/nanohttp-server.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-server.h,v 1.21 2006/05/31 19:39:34 mrcsys Exp $ + * $Id: nanohttp-server.h,v 1.22 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -21,15 +21,8 @@ * * Email: ferhatayaz@yahoo.com ******************************************************************/ -#ifndef NANO_HTTP_SERVER_H -#define NANO_HTTP_SERVER_H - - -#include -#include -#include -#include - +#ifndef __nanohttp_server_h +#define __nanohttp_server_h typedef struct httpd_conn @@ -49,6 +42,14 @@ typedef void (*httpd_service) (httpd_conn_t *, hrequest_t *); typedef int (*httpd_auth) (hrequest_t * req, const char *user, const char *password); +struct service_statistics { + unsigned long requests; + unsigned long bytes_transmitted; + unsigned long bytes_received; + struct timeval time; + pthread_rwlock_t lock; +}; + /* * Service representation object */ @@ -58,6 +59,7 @@ typedef struct tag_hservice httpd_service func; httpd_auth auth; struct tag_hservice *next; + struct service_statistics *statistics; } hservice_t; @@ -91,7 +93,8 @@ extern "C" const char *httpd_get_protocol(void); int httpd_get_conncount(void); - hservice_t *httpd_services(void); + hservice_t *httpd_get_services(void); + hservice_t *httpd_find_service(const char *name); herror_t httpd_send_header(httpd_conn_t * res, int code, const char *text); -- cgit v1.1-32-gdbae