Disable the internal webserver at build time.
This commit is contained in:
parent
9a10ef4886
commit
e4ceea33da
5 changed files with 30 additions and 2 deletions
14
net_io.c
14
net_io.c
|
|
@ -69,7 +69,9 @@
|
|||
|
||||
static int decodeBinMessage(struct client *c, char *p);
|
||||
static int decodeHexMessage(struct client *c, char *hex);
|
||||
#ifdef ENABLE_WEBSERVER
|
||||
static int handleHTTPRequest(struct client *c, char *p);
|
||||
#endif
|
||||
|
||||
static void send_raw_heartbeat(struct net_service *service);
|
||||
static void send_beast_heartbeat(struct net_service *service);
|
||||
|
|
@ -258,8 +260,10 @@ void modesInitNet(void) {
|
|||
s = makeBeastInputService();
|
||||
serviceListen(s, Modes.net_bind_address, Modes.net_input_beast_ports);
|
||||
|
||||
#ifdef ENABLE_WEBSERVER
|
||||
s = serviceInit("HTTP server", NULL, NULL, "\r\n\r\n", handleHTTPRequest);
|
||||
serviceListen(s, Modes.net_bind_address, Modes.net_http_ports);
|
||||
#endif
|
||||
}
|
||||
//
|
||||
//=========================================================================
|
||||
|
|
@ -1083,9 +1087,11 @@ static char * appendStatsJson(char *p,
|
|||
else p += snprintf(p, end-p, ",%u", st->remote_accepted[i]);
|
||||
}
|
||||
|
||||
p += snprintf(p, end-p, "]");
|
||||
p += snprintf(p, end-p, "]}");
|
||||
|
||||
p += snprintf(p, end-p, "},\"http_requests\":%u", st->http_requests);
|
||||
#ifdef ENABLE_WEBSERVER
|
||||
p += snprintf(p, end-p, ",\"http_requests\":%u", st->http_requests);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -1277,6 +1283,7 @@ void writeJsonToFile(const char *file, char * (*generator) (const char *,int*))
|
|||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_WEBSERVER
|
||||
|
||||
//
|
||||
//=========================================================================
|
||||
|
|
@ -1471,6 +1478,9 @@ static int handleHTTPRequest(struct client *c, char *p) {
|
|||
Modes.stats_current.http_requests++;
|
||||
return !keepalive;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
//=========================================================================
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue