diff --git a/platform/avr-raven/apps/raven-webserver/httpd-cgi.c b/platform/avr-raven/apps/raven-webserver/httpd-cgi.c index 2c00c20c9..0afbfb240 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.3 2009/07/23 16:16:07 dak664 Exp $ + * $Id: httpd-cgi.c,v 1.4 2009/07/24 15:41:52 dak664 Exp $ * */ @@ -50,12 +50,11 @@ #include "httpd-cgi.h" #include "httpd-fs.h" #include "httpd-fsdata.h" -//#include "lib/petsciiconv.h" -#define petsciiconv_toascii(...) +#include "lib/petsciiconv.h" #include "sensors.h" -#define DEBUGLOGIC 0 //see httpd.c +#define DEBUGLOGIC 0 //See httpd.c, if 1 must also set it there! #if DEBUGLOGIC #define uip_mss(...) 512 #define uip_appdata TCPBUF @@ -66,25 +65,25 @@ static struct httpd_cgi_call *calls = NULL; /*cgi function names*/ #if HTTPD_FS_STATISTICS -static const char file_name[] PROGMEM = "file-stats"; +static const char file_name[] HTTPD_STRING_ATTR = "file-stats"; #endif -static const char tcp_name[] PROGMEM = "tcp-connections"; -static const char proc_name[] PROGMEM = "processes"; -static const char sensor_name[] PROGMEM = "sensors"; +static const char tcp_name[] HTTPD_STRING_ATTR = "tcp-connections"; +static const char proc_name[] HTTPD_STRING_ATTR = "processes"; +static const char sensor_name[] HTTPD_STRING_ATTR = "sensors"; /*Process states for processes cgi*/ -static const char closed[] PROGMEM = "CLOSED"; -static const char syn_rcvd[] PROGMEM = "SYN-RCVD"; -static const char syn_sent[] PROGMEM = "SYN-SENT"; -static const char established[] PROGMEM = "ESTABLISHED"; -static const char fin_wait_1[] PROGMEM = "FIN-WAIT-1"; -static const char fin_wait_2[] PROGMEM = "FIN-WAIT-2"; -static const char closing[] PROGMEM = "CLOSING"; -static const char time_wait[] PROGMEM = "TIME-WAIT"; -static const char last_ack[] PROGMEM = "LAST-ACK"; -static const char none[] PROGMEM = "NONE"; -static const char running[] PROGMEM = "RUNNING"; -static const char called[] PROGMEM = "CALLED"; +static const char closed[] HTTPD_STRING_ATTR = "CLOSED"; +static const char syn_rcvd[] HTTPD_STRING_ATTR = "SYN-RCVD"; +static const char syn_sent[] HTTPD_STRING_ATTR = "SYN-SENT"; +static const char established[] HTTPD_STRING_ATTR = "ESTABLISHED"; +static const char fin_wait_1[] HTTPD_STRING_ATTR = "FIN-WAIT-1"; +static const char fin_wait_2[] HTTPD_STRING_ATTR = "FIN-WAIT-2"; +static const char closing[] HTTPD_STRING_ATTR = "CLOSING"; +static const char time_wait[] HTTPD_STRING_ATTR = "TIME-WAIT"; +static const char last_ack[] HTTPD_STRING_ATTR = "LAST-ACK"; +static const char none[] HTTPD_STRING_ATTR = "NONE"; +static const char running[] HTTPD_STRING_ATTR = "RUNNING"; +static const char called[] HTTPD_STRING_ATTR = "CALLED"; static const char *states[] = { closed, syn_rcvd, @@ -125,7 +124,7 @@ httpd_cgi(char *name) /* Find the matching name in the table, return the function. */ for(f = calls; f != NULL; f = f->next) { - if(strncmp_P(name, f->name, strlen_P(f->name)) == 0) { + if(httpd_strncmp(name, f->name, httpd_strlen(f->name)) == 0) { return f->function; } } @@ -138,6 +137,9 @@ static char *thisfilename; static unsigned short generate_file_stats(void *arg) { + static const char httpd_cgi_filestat1[] HTTPD_STRING_ATTR = "
This page has been sent %u times