diff --git a/platform/avr-raven/apps/raven-webserver/httpd-cgi.c b/platform/avr-raven/apps/raven-webserver/httpd-cgi.c index e6d21d81a..2c00c20c9 100644 --- a/platform/avr-raven/apps/raven-webserver/httpd-cgi.c +++ b/platform/avr-raven/apps/raven-webserver/httpd-cgi.c @@ -28,7 +28,7 @@ * * This file is part of the uIP TCP/IP stack. * - * $Id: httpd-cgi.c,v 1.2 2009/06/19 17:11:28 dak664 Exp $ + * $Id: httpd-cgi.c,v 1.3 2009/07/23 16:16:07 dak664 Exp $ * */ @@ -50,11 +50,18 @@ #include "httpd-cgi.h" #include "httpd-fs.h" #include "httpd-fsdata.h" - //#include "lib/petsciiconv.h" +#define petsciiconv_toascii(...) #include "sensors.h" +#define DEBUGLOGIC 0 //see httpd.c +#if DEBUGLOGIC +#define uip_mss(...) 512 +#define uip_appdata TCPBUF +extern char TCPBUF[512]; +#endif + static struct httpd_cgi_call *calls = NULL; /*cgi function names*/ @@ -133,25 +140,30 @@ generate_file_stats(void *arg) { char tmp[20]; struct httpd_fsdata_file_noconst *f,fram; - u16_t i,numprinted; + u16_t i; + unsigned short numprinted; - /* Transfer arg from flash file to RAM */ - memcpy_P_trim(tmp, (char *)arg); + /* Transfer arg from whichever flash that contains the html file to RAM */ + httpd_fs_cpy(&tmp, (char *)arg, 20); /* Count for this page, with common page footer */ if (tmp[0]=='.') { - return snprintf_P((char *)uip_appdata, uip_mss(), + numprinted=snprintf_P((char *)uip_appdata, uip_mss(), PSTR("
This page has been sent %u times