diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-06-02 18:33:41 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-06-02 18:33:41 +0000 |
commit | 1df2d73183a08fc37bc1b97a530c13a9445dad65 (patch) | |
tree | f4c857d12961f84db9c2594723974d99fc7b1bfb | |
parent | fcaaf2927914cfda505051693f5717b4a56ec04a (diff) | |
download | libbu++-1df2d73183a08fc37bc1b97a530c13a9445dad65.tar.gz libbu++-1df2d73183a08fc37bc1b97a530c13a9445dad65.tar.bz2 libbu++-1df2d73183a08fc37bc1b97a530c13a9445dad65.tar.xz libbu++-1df2d73183a08fc37bc1b97a530c13a9445dad65.zip |
Updates to the cgi system, and I'm putting the general CGI related stuff like
encoding and decoding and uri encoded splitting etc in one class.
Diffstat (limited to '')
-rw-r--r-- | src/cgiutil.cpp | 10 | ||||
-rw-r--r-- | src/cgiutil.h | 16 | ||||
-rw-r--r-- | src/fastcgi.cpp | 2 | ||||
-rw-r--r-- | src/fastcgi.h | 6 | ||||
-rw-r--r-- | src/tests/fastcgi.cpp | 4 |
5 files changed, 32 insertions, 6 deletions
diff --git a/src/cgiutil.cpp b/src/cgiutil.cpp new file mode 100644 index 0000000..1f7a8d0 --- /dev/null +++ b/src/cgiutil.cpp | |||
@@ -0,0 +1,10 @@ | |||
1 | #include "bu/cgiutil.h" | ||
2 | |||
3 | Bu::CgiUtil::CgiUtil() | ||
4 | { | ||
5 | } | ||
6 | |||
7 | Bu::CgiUtil::~CgiUtil() | ||
8 | { | ||
9 | } | ||
10 | |||
diff --git a/src/cgiutil.h b/src/cgiutil.h new file mode 100644 index 0000000..4a9ae2d --- /dev/null +++ b/src/cgiutil.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef CGI_UTIL_H | ||
2 | #define CGI_UTIL_H | ||
3 | |||
4 | namespace Bu | ||
5 | { | ||
6 | class CgiUtil | ||
7 | { | ||
8 | public: | ||
9 | CgiUtil(); | ||
10 | virtual ~CgiUtil(); | ||
11 | |||
12 | private: | ||
13 | }; | ||
14 | }; | ||
15 | |||
16 | #endif | ||
diff --git a/src/fastcgi.cpp b/src/fastcgi.cpp index 9a602de..58d886d 100644 --- a/src/fastcgi.cpp +++ b/src/fastcgi.cpp | |||
@@ -282,7 +282,7 @@ void Bu::FastCgi::run() | |||
282 | { | 282 | { |
283 | sio << "All done, generating output." << sio.nl; | 283 | sio << "All done, generating output." << sio.nl; |
284 | Bu::MemBuf mStdOut, mStdErr; | 284 | Bu::MemBuf mStdOut, mStdErr; |
285 | int iRet = request( | 285 | int iRet = onRequest( |
286 | pChan->hParams, pChan->sStdIn, | 286 | pChan->hParams, pChan->sStdIn, |
287 | mStdOut, mStdErr | 287 | mStdOut, mStdErr |
288 | ); | 288 | ); |
diff --git a/src/fastcgi.h b/src/fastcgi.h index 67ec82f..4efa992 100644 --- a/src/fastcgi.h +++ b/src/fastcgi.h | |||
@@ -95,11 +95,11 @@ namespace Bu | |||
95 | 95 | ||
96 | virtual void run(); | 96 | virtual void run(); |
97 | 97 | ||
98 | virtual void init() { }; | 98 | virtual void onInit() { }; |
99 | virtual int request( const StrHash &hParams, | 99 | virtual int onRequest( const StrHash &hParams, |
100 | const Bu::FString &sStdIn, Bu::Stream &sStdOut, | 100 | const Bu::FString &sStdIn, Bu::Stream &sStdOut, |
101 | Bu::Stream &sStdErr )=0; | 101 | Bu::Stream &sStdErr )=0; |
102 | virtual void deinit() { }; | 102 | virtual void onUninit() { }; |
103 | 103 | ||
104 | private: | 104 | private: |
105 | void read( Bu::Socket &s, Record &r ); | 105 | void read( Bu::Socket &s, Record &r ); |
diff --git a/src/tests/fastcgi.cpp b/src/tests/fastcgi.cpp index 53dd68a..e71b3c5 100644 --- a/src/tests/fastcgi.cpp +++ b/src/tests/fastcgi.cpp | |||
@@ -17,9 +17,9 @@ public: | |||
17 | { | 17 | { |
18 | } | 18 | } |
19 | 19 | ||
20 | virtual int request( const StrHash &hParams, | 20 | virtual int onRequest( const StrHash &hParams, |
21 | const Bu::FString &sStdIn, Bu::Stream &sStdOut, | 21 | const Bu::FString &sStdIn, Bu::Stream &sStdOut, |
22 | Bu::Stream &sStdErr ) | 22 | Bu::Stream &/*sStdErr*/ ) |
23 | { | 23 | { |
24 | Bu::FString sOut("Content-Type: text/html\r\n\r\n"); | 24 | Bu::FString sOut("Content-Type: text/html\r\n\r\n"); |
25 | sOut += "<html><body><h1>Environment:</h1><ul>"; | 25 | sOut += "<html><body><h1>Environment:</h1><ul>"; |