diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-01-03 04:21:28 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-01-03 04:21:28 +0000 |
commit | 3d7966138559f727a03a4b7c901508654125b7cf (patch) | |
tree | b69da50b0cd2a3e1ebdebbb776e1e20b9934f766 | |
parent | ba231cc03819353ad076941ed990c6bd37da502d (diff) |
Compile and config verify fixes for HTTP server code.
-rw-r--r-- | lib/httpserver/HTTPRequest.cpp | 11 | ||||
-rw-r--r-- | lib/httpserver/HTTPServer.cpp | 2 | ||||
-rw-r--r-- | lib/httpserver/HTTPServer.h | 3 | ||||
-rw-r--r-- | test/httpserver/testhttpserver.cpp | 1 |
4 files changed, 12 insertions, 5 deletions
diff --git a/lib/httpserver/HTTPRequest.cpp b/lib/httpserver/HTTPRequest.cpp index 2207e569..4c03e6e8 100644 --- a/lib/httpserver/HTTPRequest.cpp +++ b/lib/httpserver/HTTPRequest.cpp @@ -19,6 +19,7 @@ #include "autogen_HTTPException.h" #include "IOStream.h" #include "IOStreamGetLine.h" +#include "Logging.h" #include "MemLeakFindOn.h" @@ -219,7 +220,8 @@ bool HTTPRequest::Read(IOStreamGetLine &rGetLine, int Timeout) } } - TRACE3("HTTPRequest: method=%d, uri=%s, version=%d\n", mMethod, mRequestURI.c_str(), mHTTPVersion); + BOX_TRACE("HTTPRequest: method=" << mMethod << ", uri=" << + mRequestURI << ", version=" << mHTTPVersion); // If HTTP 1.1 or greater, assume keep-alive if(mHTTPVersion >= HTTPVersion_1_1) @@ -254,7 +256,8 @@ bool HTTPRequest::Read(IOStreamGetLine &rGetLine, int Timeout) if(fromBuffer > mContentLength) fromBuffer = mContentLength; if(fromBuffer > 0) { - TRACE1("Decoding %d bytes of data from getline buffer\n", fromBuffer); + BOX_TRACE("Decoding " << fromBuffer << " bytes of " + "data from getline buffer"); decoder.DecodeChunk((const char *)rGetLine.GetBufferedData(), fromBuffer); // And tell the getline object to ignore the data we just used rGetLine.IgnoreBufferedData(fromBuffer); @@ -368,7 +371,9 @@ void HTTPRequest::ParseHeaders(IOStreamGetLine &rGetLine, int Timeout) // Truncate the string to just the hostname mHostName = mHostName.substr(0, colon); - TRACE2("Host: header, hostname = '%s', host port = %d\n", mHostName.c_str(), mHostPort); + BOX_TRACE("Host: header, hostname = " << + "'" << mHostName << "', host " + "port = " << mHostPort); } } else if(p == sizeof("Cookie")-1 diff --git a/lib/httpserver/HTTPServer.cpp b/lib/httpserver/HTTPServer.cpp index 2db78b23..742b392f 100644 --- a/lib/httpserver/HTTPServer.cpp +++ b/lib/httpserver/HTTPServer.cpp @@ -73,7 +73,7 @@ const ConfigurationVerify *HTTPServer::GetConfigVerify() const { static ConfigurationVerifyKey verifyserverkeys[] = { - HTTPSERVER_VERIFY_SERVER_KEYS(0) // no default addresses + HTTPSERVER_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default addresses }; static ConfigurationVerify verifyserver[] = diff --git a/lib/httpserver/HTTPServer.h b/lib/httpserver/HTTPServer.h index 88da7abf..9a86b04f 100644 --- a/lib/httpserver/HTTPServer.h +++ b/lib/httpserver/HTTPServer.h @@ -65,7 +65,8 @@ private: // Root level #define HTTPSERVER_VERIFY_ROOT_KEYS \ - {"AddressPrefix", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} + ConfigurationVerifyKey("AddressPrefix", \ + ConfigTest_Exists | ConfigTest_LastEntry) // AddressPrefix is, for example, http://localhost:1080 -- ie the beginning of the URI // This is used for handling redirections. diff --git a/test/httpserver/testhttpserver.cpp b/test/httpserver/testhttpserver.cpp index 6b72748d..2ff013c9 100644 --- a/test/httpserver/testhttpserver.cpp +++ b/test/httpserver/testhttpserver.cpp @@ -16,6 +16,7 @@ #include "HTTPServer.h" #include "HTTPRequest.h" #include "HTTPResponse.h" +#include "ServerControl.h" #include "MemLeakFindOn.h" |