aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Webserver/Lib/HTTPServerApp.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-01-29 02:43:07 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-01-29 02:43:07 +0000
commitfa3135d48530930aefd5ef4ca9d0def3faae474d (patch)
tree25f479530874d3071128fa7a963251347924085d /Projects/Webserver/Lib/HTTPServerApp.h
parente81a4c950f88aeed9cf3ff5b9911afffd1862716 (diff)
downloadlufa-fa3135d48530930aefd5ef4ca9d0def3faae474d.tar.gz
lufa-fa3135d48530930aefd5ef4ca9d0def3faae474d.tar.bz2
lufa-fa3135d48530930aefd5ef4ca9d0def3faae474d.zip
Add MIME type handling to the Webserver project, so that files of different types (e.g. images) can be served out to HTTP clients.
Diffstat (limited to 'Projects/Webserver/Lib/HTTPServerApp.h')
-rw-r--r--Projects/Webserver/Lib/HTTPServerApp.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/Projects/Webserver/Lib/HTTPServerApp.h b/Projects/Webserver/Lib/HTTPServerApp.h
index b96e2e303..7a4c87374 100644
--- a/Projects/Webserver/Lib/HTTPServerApp.h
+++ b/Projects/Webserver/Lib/HTTPServerApp.h
@@ -39,21 +39,31 @@
/* Includes: */
#include <avr/pgmspace.h>
#include <string.h>
+ #include <ctype.h>
#include <LUFA/Version.h>
#include <uip.h>
#include <ff.h>
-
+
/* 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_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_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 */