The lib with which to make LPC1768 a simple HTTP server. This have not yet implemented. fopen() DOESN'T WORK after EthernetInterface::connect() is called as using mbed-os 5.4~. See also https://os.mbed.com/questions/80658/HardFault-occurs-when-fopen-is-called-af/ or https://github.com/ARMmbed/mbed-os/issues/6578 and https://github.com/ARMmbed/mbed-os/issues/6624

Fork of HTTP_SERVER by Akifumi Takahashi

Revision:
11:0ee7d100db24
Parent:
10:4a48594c2f44
Child:
16:c3920b5b8572
--- a/handlers/Filehandler.cpp	Thu Dec 08 05:56:53 2016 +0000
+++ b/handlers/Filehandler.cpp	Thu Dec 08 10:10:43 2016 +0000
@@ -25,11 +25,11 @@
 {
     FILE *tmp;
 
-    printf("\r\n"
-           "fp: %d@FileHandler::open\r\n", fp);
+    //////printf("\r\n"
+    //       "fp: %d@FileHandler::open\r\n", fp);
     if (fullpath != NULL) free(fullpath);
     fullpath = (char*)malloc(sizeof(char) * (strlen("/local/") + strlen(arg_filepath) + strlen("index.htm") + 1));
-    printf("fp: %d@FileHandler::open\r\n", fp);
+    //////printf("fp: %d@FileHandler::open\r\n", fp);
 
     //  Path formatting
     if (arg_filepath[0] == '/') {
@@ -47,31 +47,31 @@
     suffix = strchr(filename, '.');
     if(suffix   != NULL)    suffix++;   //  remove '.' and just get only the suffix.
 #ifdef DEBUG
-    printf("full path: %s\r\nfilename: %s\r\nsuffix: %s\r\n", getFullpath(), getFilename(), getSuffix());
+    //////printf("full path: %s\r\nfilename: %s\r\nsuffix: %s\r\n", getFullpath(), getFilename(), getSuffix());
 #endif
     fp = fopen(fullpath, arg_mode);
 #ifdef DEBUG
-    printf("file opened@FileHandler::open\r\n");
+    //////////printf("file opened@FileHandler::open\r\n");
 #endif
     //  mesure file size
     file_size = 0;
     tmp = fp;
     if(tmp != NULL ) {
-        printf("\r\nfile content\r\n");
+        ////printf("\r\nfile content\r\n");
         int ctmp;
         while(1) {
             ctmp = fgetc(tmp);
             if(ctmp != EOF) {
-                printf("%c", ctmp);
+                //////printf("%c", ctmp);
                 file_size++;
             } else {
-                printf("[EOF]\r\n");
+                //////printf("[EOF]\r\n");
                 break;
             }
         }
-        printf("file size: %d\r\n", file_size);
+        ////printf("file size: %d\r\n", file_size);
         if(fseek(tmp, 0L, SEEK_SET) != 0) {
-            printf("fseek failed\r\n");
+            //////printf("fseek failed\r\n");
         }
     } else {
         file_size = 0;
@@ -95,7 +95,7 @@
 int FileHandler::getc()
 {
     int tmp = fgetc(fp);
-
+#ifdef DEBUG
     if(0x20 < tmp && tmp < 0x7e)
         printf("%c", tmp);
     else if (tmp == '\r')
@@ -104,8 +104,8 @@
         printf("\n");
     else
         printf("@");
-
-    return tmp;//fgetc(fp);
+#endif
+    return tmp;
 }
 bool FileHandler::arrival()
 {