'+text+' | '+''+' | '+' |
Addresses %! addresses -+%! file-stats . \ No newline at end of file diff --git a/apps/webserver-nano/httpd-fs/status.shtml b/apps/webserver-nano/httpd-fs/status.shtml index d18b74e28..501203f0f 100644 --- a/apps/webserver-nano/httpd-fs/status.shtml +++ b/apps/webserver-nano/httpd-fs/status.shtml @@ -1,10 +1,14 @@ %! header -Neighbors
+ +Neighbors %! neighbors -Routes
+ +Routes %! routes -Sensors
+ +Sensors %! sensors -%! file-stats . +
Addresses
+
Addresses %! addresses -+%! file-stats . \ No newline at end of file diff --git a/apps/webserver-nano/httpd.c b/apps/webserver-nano/httpd.c index 7971832b8..234b76bb3 100644 --- a/apps/webserver-nano/httpd.c +++ b/apps/webserver-nano/httpd.c @@ -94,7 +94,6 @@ static PT_THREAD(send_file(struct httpd_state *s)) { PSOCK_BEGIN(&s->sout); - do { PSOCK_GENERATOR_SEND(&s->sout, generate, s); s->file.len -= s->len; @@ -488,11 +487,18 @@ httpd_appcall(void *state) PT_INIT(&s->outputpt); s->state = STATE_WAITING; s->timer = 0; +#if WEBSERVER_CONF_AJAX + s->ajax_timeout = WEBSERVER_CONF_TIMEOUT; +#endif handle_connection(s); } else if(s != NULL) { if(uip_poll()) { ++s->timer; - if(s->timer >= 20) { +#if WEBSERVER_CONF_AJAX + if(s->timer >= s->ajax_timeout) { +#else + if(s->timer >= WEBSERVER_CONF_TIMEOUT) { +#endif uip_abort(); memb_free(&conns, s); } diff --git a/apps/webserver-nano/httpd.h b/apps/webserver-nano/httpd.h index 3226a79b4..d10d389ef 100644 --- a/apps/webserver-nano/httpd.h +++ b/apps/webserver-nano/httpd.h @@ -76,6 +76,8 @@ #define WEBSERVER_CONF_CONNS 2 #define WEBSERVER_CONF_NAMESIZE 16 #define WEBSERVER_CONF_BUFSIZE 40 +/* Short tcp timeouts allow new connections sooner */ +#define WEBSERVER_CONF_TIMEOUT 20 /* Allow include in .shtml pages, e.g. %!: /header.html */ #define WEBSERVER_CONF_INCLUDE 1 /* Allow cgi in .shtml pages, e.g. %! file-stats . */ @@ -116,13 +118,13 @@ extern char httpd_query[WEBSERVER_CONF_PASSQUERY]; #define WEBSERVER_CONF_LOG 0 /* Include referrer in log */ #define WEBSERVER_CONF_REFERER 0 - /*-----------------------------------------------------------------------------*/ #elif WEBSERVER_CONF_NANO==2 /* webserver-mini having more content */ #define WEBSERVER_CONF_CONNS 2 #define WEBSERVER_CONF_NAMESIZE 20 #define WEBSERVER_CONF_BUFSIZE 40 +#define WEBSERVER_CONF_TIMEOUT 20 /* Allow include in .shtml pages, e.g. %!: /header.html */ #define WEBSERVER_CONF_INCLUDE 1 /* Allow cgi in .shtml pages, e.g. %! file-stats . */ @@ -148,7 +150,7 @@ extern char httpd_query[WEBSERVER_CONF_PASSQUERY]; //#define WEBSERVER_CONF_TICTACTOE 1 //Needs passquery of at least 10 chars #define WEBSERVER_CONF_AJAX 1 #define WEBSERVER_CONF_SHOW_ROOM 0 -//#define WEBSERVER_CONF_PASSQUERY 10 +#define WEBSERVER_CONF_PASSQUERY 10 #if WEBSERVER_CONF_PASSQUERY extern char httpd_query[WEBSERVER_CONF_PASSQUERY]; #endif @@ -171,6 +173,7 @@ extern char httpd_query[WEBSERVER_CONF_PASSQUERY]; #define WEBSERVER_CONF_CONNS 6 #define WEBSERVER_CONF_NAMESIZE 20 #define WEBSERVER_CONF_BUFSIZE 40 +#define WEBSERVER_CONF_TIMEOUT 20 /* Allow include in .shtml pages, e.g. %!: /header.html */ #define WEBSERVER_CONF_INCLUDE 1 /* Allow cgi in .shtml pages, e.g. %! file-stats . */ @@ -285,6 +288,9 @@ struct httpd_state { #if WEBSERVER_CONF_LOADTIME clock_time_t pagetime; #endif +#if WEBSERVER_CONF_AJAX + uint16_t ajax_timeout; +#endif #if WEBSERVER_CONF_NEIGHBORS || WEBSERVER_CONF_ROUTES uint8_t starti,savei,startj,savej; #endifNeighbors
+ +Neighbors %! neighbors -Routes
+ +Routes %! routes -Sensors
+ +Sensors %! sensors -%! file-stats . +