Added ENABLE_TELNET_SERVER compile time option to the Webserver project to disable...
[pub/USBasp.git] / Projects / Webserver / Lib / HTTPServerApp.c
index 1a1d2c4..08d8494 100644 (file)
@@ -56,12 +56,12 @@ const char PROGMEM HTTP404Header[] = "HTTP/1.1 404 Not Found\r\n"
                                      "Content-Type: text/plain\r\n\r\n"\r
                                      "Error 404: File Not Found: /";\r
 \r
                                      "Content-Type: text/plain\r\n\r\n"\r
                                      "Error 404: File Not Found: /";\r
 \r
-/** Default MIME type sent if no other MIME type can be determined. */\r
-const char PROGMEM DefaultMIMEType[] = "text/plain";\r
-\r
 /** Default filename to fetch when a directory is requested */\r
 const char PROGMEM DefaultDirFileName[] = "index.htm";\r
 \r
 /** Default filename to fetch when a directory is requested */\r
 const char PROGMEM DefaultDirFileName[] = "index.htm";\r
 \r
+/** Default MIME type sent if no other MIME type can be determined. */\r
+const char PROGMEM DefaultMIMEType[] = "text/plain";\r
+\r
 /** List of MIME types for each supported file extension. */\r
 const MIME_Type_t MIMETypes[] =\r
        {\r
 /** List of MIME types for each supported file extension. */\r
 const MIME_Type_t MIMETypes[] =\r
        {\r
@@ -174,7 +174,7 @@ static void HTTPServerApp_OpenRequestedFile(void)
        char* RequestedFileName = strtok(NULL, " ");\r
                        \r
        /* Must be a GET request, abort otherwise */\r
        char* RequestedFileName = strtok(NULL, " ");\r
                        \r
        /* Must be a GET request, abort otherwise */\r
-       if (strcmp(RequestToken, "GET") != 0)\r
+       if (strcmp_P(RequestToken, PSTR("GET")) != 0)\r
        {\r
                uip_abort();\r
                return;\r
        {\r
                uip_abort();\r
                return;\r
@@ -257,7 +257,7 @@ static void HTTPServerApp_SendResponseHeader(void)
        }\r
        \r
        /* Add the end-of-line terminator and end-of-headers terminator after the MIME type */\r
        }\r
        \r
        /* Add the end-of-line terminator and end-of-headers terminator after the MIME type */\r
-       strcpy(&AppData[strlen(AppData)], "\r\n\r\n");\r
+       strcpy_P(&AppData[strlen(AppData)], PSTR("\r\n\r\n"));\r
        \r
        /* Send the MIME header to the receiving client */\r
        uip_send(AppData, strlen(AppData));\r
        \r
        /* Send the MIME header to the receiving client */\r
        uip_send(AppData, strlen(AppData));\r