X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d11ed10c5314c44dc01c06954d1d73d4894cbff8..9e7ffcb014d08d9f541cc8000b34f600b437a78e:/Projects/Webserver/Lib/HTTPServerApp.h?ds=sidebyside diff --git a/Projects/Webserver/Lib/HTTPServerApp.h b/Projects/Webserver/Lib/HTTPServerApp.h index b96e2e303..91956ce07 100644 --- a/Projects/Webserver/Lib/HTTPServerApp.h +++ b/Projects/Webserver/Lib/HTTPServerApp.h @@ -40,20 +40,28 @@ #include #include - #include - #include #include - + /* Enums: */ /** States for each HTTP connection to the webserver. */ enum Webserver_States_t { WEBSERVER_STATE_OpenRequestedFile, /** Currently opening requested file */ - WEBSERVER_STATE_SendHeaders, /**< Currently sending HTTP headers to the client */ - WEBSERVER_STATE_SendData, /**< Currently sending HTTP page data to the client */ - WEBSERVER_STATE_Closed, /**< Connection closed after all data sent */ + WEBSERVER_STATE_SendResponseHeader, /**< Currently sending HTTP response headers to the client */ + WEBSERVER_STATE_SendMIMETypeHeader, /**< Currently sending HTTP MIME type header to the client */ + WEBSERVER_STATE_SendData, /**< Currently sending HTTP page data to the client */ + WEBSERVER_STATE_Closing, /**< Ready to close the connection to the client */ + WEBSERVER_STATE_Closed, /**< Connection closed after all data sent */ }; + + /* Type Defines: */ + /** Type define for a MIME type handler. */ + typedef struct + { + char Extension[4]; /**< 3 or less character file extension */ + char MIMEType[30]; /**< Appropriate MIME type to send when the extension is encountered */ + } MIME_Type_t; /* Macros: */ /** TCP listen port for incomming HTTP traffic */ @@ -63,4 +71,11 @@ void WebserverApp_Init(void); void WebserverApp_Callback(void); + #if defined(INCLUDE_FROM_HTTPSERVERAPP_C) + static void Webserver_OpenRequestedFile(void); + static void Webserver_SendResponseHeader(void); + static void Webserver_SendMIMETypeHeader(void); + static void Webserver_SendData(void); + #endif + #endif