summaryrefslogtreecommitdiff
path: root/src/protocolhttp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocolhttp.h')
-rw-r--r--src/protocolhttp.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/protocolhttp.h b/src/protocolhttp.h
index e10cb23..e2612f5 100644
--- a/src/protocolhttp.h
+++ b/src/protocolhttp.h
@@ -24,6 +24,30 @@ namespace Bu
24 24
25 virtual void onNewConnection( Bu::Client *pClient ); 25 virtual void onNewConnection( Bu::Client *pClient );
26 virtual void onNewData( Bu::Client *pClient ); 26 virtual void onNewData( Bu::Client *pClient );
27
28 virtual void onRequest(
29 const Bu::FString &sMethod, const Bu::FString &sPath )=0;
30
31 class Response
32 {
33 friend class Bu::ProtocolHttp;
34 public:
35 Response( int iCode );
36 Response( int iCode, const Bu::FString &sReason );
37 virtual ~Response();
38
39 void setHeader( const Bu::FString &sKey, const Bu::FString &sVal );
40 void setContent( const Bu::FString &sCont );
41
42 private:
43 int iCode;
44 Bu::FString sReason;
45 typedef Bu::Hash<Bu::FString,Bu::FString> StringHash;
46 StringHash hHeaders;
47 Bu::FString sContent;
48 };
49
50 void sendResponse( const Response &rRes );
27 51
28 private: 52 private:
29 enum TokenType 53 enum TokenType
@@ -47,6 +71,9 @@ namespace Bu
47 bool isWS( char buf ); 71 bool isWS( char buf );
48 bool isSeperator( char buf ); 72 bool isSeperator( char buf );
49 73
74 void earlyResponse();
75 void lateResponse();
76
50 private: /* state */ 77 private: /* state */
51 Bu::Client *pClient; 78 Bu::Client *pClient;
52 TokenList lTokens; 79 TokenList lTokens;