mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Fix problem in conditional compilation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1647 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -51,11 +51,26 @@
|
|||||||
* Pre-processor Definitions
|
* 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
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_NETUTILS_HTTPDFILESTATS
|
||||||
HTTPD_CGI_CALL(file, "file-stats", file_stats);
|
HTTPD_CGI_CALL(file, "file-stats", file_stats);
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_NETUTILS_HTTPDNETSTATS
|
#ifdef CONFIG_NETUTILS_HTTPDNETSTATS
|
||||||
HTTPD_CGI_CALL(net, "net-stats", net_stats);
|
HTTPD_CGI_CALL(net, "net-stats", net_stats);
|
||||||
#endif
|
#endif
|
||||||
@@ -94,10 +109,18 @@ static const char last_ack[] = /* "LAST-ACK"*/
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: nullfunction
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
static void nullfunction(struct httpd_state *pstate, char *ptr)
|
static void nullfunction(struct httpd_state *pstate, char *ptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: net_stats
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NETUTILS_HTTPDNETSTATS
|
#ifdef CONFIG_NETUTILS_HTTPDNETSTATS
|
||||||
static void net_stats(struct httpd_state *pstate, char *ptr)
|
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
|
#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
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -131,13 +168,3 @@ httpd_cgifunction httpd_cgi(char *name)
|
|||||||
}
|
}
|
||||||
return nullfunction;
|
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user