Fixed accuracy of the SERIAL_UBBRVAL() and SERIAL_2X_UBBRVAL() macros for higher...
[pub/USBasp.git] / Projects / Webserver / Lib / HTTPServerApp.c
index 9a70dad..ad768c8 100644 (file)
@@ -41,7 +41,7 @@
  *  given location, and gives extra connection information.\r
  */\r
 char PROGMEM HTTP200Header[] = "HTTP/1.1 200 OK\r\n"\r
  *  given location, and gives extra connection information.\r
  */\r
 char PROGMEM HTTP200Header[] = "HTTP/1.1 200 OK\r\n"\r
-                               "Server: LUFA RNDIS\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
                                "Connection: close\r\n"\r
                                "MIME-version: 1.0\r\n"\r
                                "Content-Type: ";\r
@@ -50,7 +50,7 @@ char PROGMEM HTTP200Header[] = "HTTP/1.1 200 OK\r\n"
  *  given URL is invalid, and gives extra error information.\r
  */\r
 char PROGMEM HTTP404Header[] = "HTTP/1.1 404 Not Found\r\n"\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 RNDIS\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
                                "Connection: close\r\n"\r
                                "MIME-version: 1.0\r\n"\r
                                "Content-Type: text/plain\r\n\r\n"\r
@@ -150,7 +150,7 @@ void HTTPServerApp_Callback(void)
        }               \r
 }\r
 \r
        }               \r
 }\r
 \r
-/** HTTP Server State handler for the Request Process state. This state manages the processing of incomming HTTP\r
+/** HTTP Server State handler for the Request Process state. This state manages the processing of incoming HTTP\r
  *  GET requests to the server from the receiving HTTP client.\r
  */\r
 static void HTTPServerApp_OpenRequestedFile(void)\r
  *  GET requests to the server from the receiving HTTP client.\r
  */\r
 static void HTTPServerApp_OpenRequestedFile(void)\r
@@ -198,8 +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
        uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;\r
        char*               const AppData     = (char*)uip_appdata;\r
 \r
-       char*    HeaderToSend;\r
-       uint16_t HeaderLength;\r
+       char* HeaderToSend;\r
 \r
        /* Determine which HTTP header should be sent to the client */\r
        if (AppState->HTTPServer.FileOpen)\r
 \r
        /* Determine which HTTP header should be sent to the client */\r
        if (AppState->HTTPServer.FileOpen)\r
@@ -214,9 +213,8 @@ static void HTTPServerApp_SendResponseHeader(void)
        }\r
 \r
        /* Copy over the HTTP response header and send it to the receiving client */\r
        }\r
 \r
        /* Copy over the HTTP response header and send it to the receiving client */\r
-       HeaderLength = strlen_P(HeaderToSend);\r
-       strncpy_P(AppData, HeaderToSend, HeaderLength);\r
-       uip_send(AppData, HeaderLength);\r
+       strcpy_P(AppData, HeaderToSend);\r
+       uip_send(AppData, strlen(AppData));\r
 }\r
 \r
 /** HTTP Server State handler for the MIME Header Send state. This state manages the transmission of the file\r
 }\r
 \r
 /** HTTP Server State handler for the MIME Header Send state. This state manages the transmission of the file\r