Move DHCP negotiation timer into the DHCP connection application state structure...
[pub/USBasp.git] / Projects / Webserver / Lib / HTTPServerApp.c
index ad768c8..e781beb 100644 (file)
 /** HTTP server response header, for transmission before the page contents. This indicates to the host that a page exists at the\r
  *  given location, and gives extra connection information.\r
  */\r
-char PROGMEM HTTP200Header[] = "HTTP/1.1 200 OK\r\n"\r
-                               "Server: LUFA " LUFA_VERSION_STRING "\r\n"\r
-                               "Connection: close\r\n"\r
-                               "MIME-version: 1.0\r\n"\r
-                               "Content-Type: ";\r
+const char PROGMEM HTTP200Header[] = "HTTP/1.1 200 OK\r\n"\r
+                                     "Server: LUFA " LUFA_VERSION_STRING "\r\n"\r
+                                     "Connection: close\r\n"\r
+                                     "MIME-version: 1.0\r\n"\r
+                                     "Content-Type: ";\r
 \r
 /** HTTP server response header, for transmission before a resource not found error. This indicates to the host that the given\r
  *  given URL is invalid, and gives extra error information.\r
  */\r
-char PROGMEM HTTP404Header[] = "HTTP/1.1 404 Not Found\r\n"\r
-                               "Server: LUFA " LUFA_VERSION_STRING "\r\n"\r
-                               "Connection: close\r\n"\r
-                               "MIME-version: 1.0\r\n"\r
-                               "Content-Type: text/plain\r\n\r\n"\r
-                               "Error 404: File Not Found";\r
+const char PROGMEM HTTP404Header[] = "HTTP/1.1 404 Not Found\r\n"\r
+                                     "Server: LUFA " LUFA_VERSION_STRING "\r\n"\r
+                                     "Connection: close\r\n"\r
+                                     "MIME-version: 1.0\r\n"\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
-char PROGMEM DefaultMIMEType[] = "text/plain";\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
-MIME_Type_t PROGMEM MIMETypes[] =\r
+const MIME_Type_t MIMETypes[] =\r
        {\r
                {.Extension = "htm", .MIMEType = "text/html"},\r
                {.Extension = "jpg", .MIMEType = "image/jpeg"},\r
@@ -198,7 +198,7 @@ static void HTTPServerApp_SendResponseHeader(void)
        uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;\r
        char*               const AppData     = (char*)uip_appdata;\r
 \r
-       char* HeaderToSend;\r
+       const char* HeaderToSend;\r
 \r
        /* Determine which HTTP header should be sent to the client */\r
        if (AppState->HTTPServer.FileOpen)\r
@@ -234,10 +234,10 @@ static void HTTPServerApp_SendMIMETypeHeader(void)
                /* Look through the MIME type list, copy over the required MIME type if found */\r
                for (int i = 0; i < (sizeof(MIMETypes) / sizeof(MIMETypes[0])); i++)\r
                {\r
-                       if (strcmp_P(&Extension[1], MIMETypes[i].Extension) == 0)\r
+                       if (strcmp(&Extension[1], MIMETypes[i].Extension) == 0)\r
                        {\r
-                               MIMEHeaderLength = strlen_P(MIMETypes[i].MIMEType);\r
-                               strncpy_P(AppData, MIMETypes[i].MIMEType, MIMEHeaderLength);                                            \r
+                               MIMEHeaderLength = strlen(MIMETypes[i].MIMEType);\r
+                               strncpy(AppData, MIMETypes[i].MIMEType, MIMEHeaderLength);                                              \r
                                break;\r
                        }\r
                } \r