Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SmartRemote WifiFlexManager SmartRemote E7
Fork of HTTPServer by
Diff: HTTPServer.h
- Revision:
- 2:8653bbcf7e58
- Parent:
- 1:6b7472d5e9ee
- Child:
- 3:d6224049b3bf
--- a/HTTPServer.h Sun May 26 22:49:42 2013 +0000 +++ b/HTTPServer.h Sun May 26 23:22:36 2013 +0000 @@ -52,7 +52,9 @@ void addHandler(const char* path, HTTPRequestHandlerFunction hdlFunc) { m_pHandlers[path] = hdlFunc; } - + + void addErrorHandler(HTTPRequestHandlerFunction hdlFunc) + { m_pErrorHandler = hdlFunc!=NULL ?hdlFunc : StdErrorHandler; } ///Starts listening /** Binds server to a specific port and starts listening. This member prepares the internal variables and the server socket @@ -70,6 +72,8 @@ private: + static void StdErrorHandler(HTTPMessage&, TCPSocketConnection&); + TCPSocketServer* m_pSvr; bool m_bServerListening; @@ -77,6 +81,8 @@ void HandleRequest(HTTPMessage& con, TCPSocketConnection&); map<string, HTTPRequestHandlerFunction> m_pHandlers; + HTTPRequestHandlerFunction m_pErrorHandler; + }; #endif //__HTTPSERVER_H__ \ No newline at end of file