Added support for refer logging
diff --git a/contiki/apps/webserver.c b/contiki/apps/webserver.c
index 0f84a38..971077c 100644
--- a/contiki/apps/webserver.c
+++ b/contiki/apps/webserver.c
@@ -29,7 +29,7 @@
  *
  * This file is part of the Contiki desktop environment for the C64.
  *
- * $Id: webserver.c,v 1.12 2004/07/04 17:50:39 adamdunkels Exp $
+ * $Id: webserver.c,v 1.13 2004/09/12 07:20:04 adamdunkels Exp $
  *
  */
 
@@ -65,8 +65,8 @@
 static ek_id_t id = EK_ID_NONE;
 
 
-#define LOG_WIDTH  30
-#define LOG_HEIGHT 16
+#define LOG_WIDTH  38
+#define LOG_HEIGHT 23
 static char log[LOG_WIDTH*LOG_HEIGHT];
 
 static struct ctk_label loglabel =
@@ -100,6 +100,8 @@
     ek_exit();
     id = EK_ID_NONE;
     LOADER_UNLOAD();    
+  } else if(ev == tcpip_event) {
+    httpd_appcall(data);
   }
 }
 /*-----------------------------------------------------------------------------------*/
@@ -126,3 +128,16 @@
   CTK_WIDGET_REDRAW(&loglabel);
 }
 /*-----------------------------------------------------------------------------------*/
+void
+webserver_log(char *msg)
+{
+  /* Scroll previous entries upwards */
+  memcpy(log, &log[LOG_WIDTH], LOG_WIDTH * (LOG_HEIGHT - 1));
+
+  /* Copy filename into last line. */		 
+  strncpy(&log[LOG_WIDTH * (LOG_HEIGHT - 1)], msg, LOG_WIDTH);
+  
+  /* Update log display. */
+  CTK_WIDGET_REDRAW(&loglabel);
+}
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki/apps/webserver.h b/contiki/apps/webserver.h
index 26499d8..64f8d57 100644
--- a/contiki/apps/webserver.h
+++ b/contiki/apps/webserver.h
@@ -29,12 +29,17 @@
  *
  * This file is part of the Contiki desktop environment for the C64.
  *
- * $Id: webserver.h,v 1.4 2004/07/04 17:50:39 adamdunkels Exp $
+ * $Id: webserver.h,v 1.5 2004/09/12 07:20:04 adamdunkels Exp $
  *
  */
 #ifndef __WEBSERVER_H__
 #define __WEBSERVER_H__
 
+#include "uip.h"
+
 void webserver_init(char *arg);
+void webserver_log(char *msg);
+void webserver_log_file(u16_t *requester, char *file);
+
 
 #endif /* __WEBSERVER_H__ */