Team E1

Fork of HTTPServer by Sam Kirsch

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