From 2a6f169e4607d4436c0c5d94c81a3fd414d2812e Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Wed, 3 Feb 2010 23:19:39 +0000 Subject: [PATCH] - Added yet another PETSCII->ASCII conversion, this time for the file name in case of a 404. - Use all lowercase for the 404 message to avoid another PETSCII->ASCII conversion. - Write logfile entries for all 404s. - Adjust memory buffers on the C128 to accomodate for the items above. --- apps/webserver/httpd-cfs.c | 6 ++++-- platform/c128/contiki-conf.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/webserver/httpd-cfs.c b/apps/webserver/httpd-cfs.c index f34bdd870..3c1731190 100644 --- a/apps/webserver/httpd-cfs.c +++ b/apps/webserver/httpd-cfs.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: httpd-cfs.c,v 1.14 2010/02/03 21:06:51 adamdunkels Exp $ + * $Id: httpd-cfs.c,v 1.15 2010/02/03 23:19:40 oliverschmidt Exp $ */ #include @@ -133,17 +133,19 @@ PT_THREAD(handle_output(struct httpd_state *s)) if(s->fd < 0) { strcpy(s->filename, "notfound.html"); s->fd = cfs_open(s->filename, CFS_READ); + petsciiconv_toascii(s->filename, sizeof(s->filename)); if(s->fd < 0) { PT_WAIT_THREAD(&s->outputpt, send_headers(s, http_header_404)); PT_WAIT_THREAD(&s->outputpt, - send_string(s, "Not found")); + send_string(s, "not found")); uip_close(); webserver_log_file(&uip_conn->ripaddr, "404 (no notfound.html)"); PT_EXIT(&s->outputpt); } PT_WAIT_THREAD(&s->outputpt, send_headers(s, http_header_404)); + webserver_log_file(&uip_conn->ripaddr, "404 - notfound.html"); } else { PT_WAIT_THREAD(&s->outputpt, send_headers(s, http_header_200)); diff --git a/platform/c128/contiki-conf.h b/platform/c128/contiki-conf.h index c01cb561e..dbe10e00e 100644 --- a/platform/c128/contiki-conf.h +++ b/platform/c128/contiki-conf.h @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-conf.h,v 1.8 2010/02/03 22:53:59 oliverschmidt Exp $ + * $Id: contiki-conf.h,v 1.9 2010/02/03 23:19:39 oliverschmidt Exp $ */ #ifndef __CONTIKI_CONF_H__ @@ -64,7 +64,7 @@ #define IRC_CONF_HEIGHT 24 #define WEBSERVER_CONF_CGI_CONNS UIP_CONNS -#define WEBSERVER_CONF_CFS_CONNS 8 +#define WEBSERVER_CONF_CFS_CONNS 7 #define WWW_CONF_WEBPAGE_WIDTH 80 #define WWW_CONF_WEBPAGE_HEIGHT 20