diff --git a/netutils/webserver/httpd_cgi.c b/netutils/webserver/httpd_cgi.c index d8a7523f8d..a51a4e2738 100644 --- a/netutils/webserver/httpd_cgi.c +++ b/netutils/webserver/httpd_cgi.c @@ -51,11 +51,26 @@ * Pre-processor Definitions ****************************************************************************/ +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void nullfunction(struct httpd_state *pstate, char *ptr); +#ifdef CONFIG_NETUTILS_HTTPDNETSTATS +static void net_stats(struct httpd_state *pstate, char *ptr); +#endif + +#ifdef CONFIG_NETUTILS_HTTPDFILESTATS +static void file_stats(struct httpd_state *pstate, char *ptr); +#endif + /**************************************************************************** * Private Data ****************************************************************************/ +#ifdef CONFIG_NETUTILS_HTTPDFILESTATS HTTPD_CGI_CALL(file, "file-stats", file_stats); +#endif #ifdef CONFIG_NETUTILS_HTTPDNETSTATS HTTPD_CGI_CALL(net, "net-stats", net_stats); #endif @@ -94,10 +109,18 @@ static const char last_ack[] = /* "LAST-ACK"*/ * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: nullfunction + ****************************************************************************/ + static void nullfunction(struct httpd_state *pstate, char *ptr) { } +/**************************************************************************** + * Name: net_stats + ****************************************************************************/ + #ifdef CONFIG_NETUTILS_HTTPDNETSTATS static void net_stats(struct httpd_state *pstate, char *ptr) { @@ -112,6 +135,20 @@ static void net_stats(struct httpd_state *pstate, char *ptr) } #endif +/**************************************************************************** + * Name: file_stats + ****************************************************************************/ + +#ifdef CONFIG_NETUTILS_HTTPDFILESTATS +static void file_stats(struct httpd_state *pstate, char *ptr) +{ + char buffer[16]; + char *pcount = strchr(ptr, ' ') + 1; + snprintf(buffer, 16, "%5u", httpd_fs_count(pcount)); + (void)send(pstate->ht_sockfd, buffer, strlen(buffer), 0); +} +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -131,13 +168,3 @@ httpd_cgifunction httpd_cgi(char *name) } return nullfunction; } - -#ifdef CONFIG_NETUTILS_HTTPDFILESTATS -static void file_stats(struct httpd_state *pstate, char *ptr) -{ - char buffer[16]; - char *pcount = strchr(ptr, ' ') + 1; - snprintf(buffer, 16, "%5u", httpd_fs_count(pcount)); - (void)send(pstate->ht_sockfd, buffer, strlen(buffer), 0); -} -#endif