A simple web server that can be bound to either the EthernetInterface or the WiflyInterface.
Dependents: Smart-WiFly-WebServer WattEye X10Svr SSDP_Server
Diff: SW_HTTPServer.h
- Revision:
- 29:00116fc9da74
- Parent:
- 28:f93ef41b78e1
- Child:
- 32:7ded9bacb546
diff -r f93ef41b78e1 -r 00116fc9da74 SW_HTTPServer.h --- a/SW_HTTPServer.h Fri Oct 11 02:33:46 2013 +0000 +++ b/SW_HTTPServer.h Fri Oct 11 23:47:31 2013 +0000 @@ -2,7 +2,7 @@ #ifndef SW_HTTPSERVER_H #define SW_HTTPSERVER_H #include "mbed.h" -//#include "MODSERIAL.h" // would like to hook in mod serial for higher performance, less blocking +#include "MODSERIAL.h" // would like to hook in mod serial for higher performance, less blocking #include "Wifly.h" #include "TCPSocketServer.h" #include "TCPSocketConnection.h" @@ -208,13 +208,13 @@ * on the CONTENT_LENGTH_REQUEST callback. The data is now available for processing. * The callback should return true to continue the processing. * @li SEND_PAGE - the callback should now send the html page, using as many svr->send() as needed. - * When the callback returns, it should always indicate true. + * When the callback returns, it should always indicate true that it has sent the page. * * @note The queryParams pointer purpose depends on the callback type. * For CONTENT_LENGTH_REQUEST, the pointer points to the name=value pairs from the * header. * For DATA_TRANSFER, the pointer points to the start of the actual data. - * For SEND_PAGE, + * For SEND_PAGE, ... <to be determined> * * @param svr is a handle to this class, so the callback has access to member functions * @param queryParams is a pointer based on the callback type. @@ -613,11 +613,16 @@ bool Extract(char * rec, char * needle, char ** string); void SendResponse(); - bool ParseHeader(char * bPtr); + HTTPServer::CallBackResults ParseHeader(char * bPtr); bool CheckDynamicHandlers(); int HexCharToInt(char c); char HexPairToChar(char * p); + + #ifdef DEBUG + void * MyMalloc(int x, int y); + char toP(void * x); + #endif }; #endif //SW_HTTPSERVER_H