- PageBlock = 0;\r
-\r
- /* Copy the HTTP response header into the packet buffer */\r
- strcpy_P(BufferDataStr, HTTPHeader);\r
- \r
- /* Send the buffer contents to the host */\r
- TCP_APP_SEND_BUFFER(Buffer, strlen(BufferDataStr));\r
-\r
- /* Lock the buffer to Device->Host transmissions only while we send the page contents */\r
- TCP_APP_CAPTURE_BUFFER(Buffer);\r
+ if (IsHTTPCommand(Buffer->Data, "GET / "))\r
+ {\r
+ PageBlock = 0;\r
+\r
+ /* Copy the HTTP 200 response header into the packet buffer */\r
+ strcpy_P(BufferDataStr, HTTP200Header);\r
+ \r
+ /* Send the buffer contents to the host */\r
+ TCP_APP_SEND_BUFFER(Buffer, strlen(BufferDataStr));\r
+\r
+ /* Lock the buffer to Device->Host transmissions only while we send the page contents */\r
+ TCP_APP_CAPTURE_BUFFER(Buffer);\r
+ }\r
+ else\r
+ {\r
+ /* Copy the HTTP 404 response header into the packet buffer */\r
+ strcpy_P(BufferDataStr, HTTP404Header);\r
+ \r
+ /* Send the buffer contents to the host */\r
+ TCP_APP_SEND_BUFFER(Buffer, strlen(BufferDataStr));\r
+ \r
+ /* All data sent, close the connection */\r
+ TCP_APP_CLOSECONNECTION(ConnectionState);\r
+ }\r