diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-01-05 00:49:34 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-01-05 00:49:34 +0000 |
commit | 5ec745e22e1693e5704ff8579f4b66dbea837447 (patch) | |
tree | 72396110c2b2b34b4e892f11e342e2054edfcc2d | |
parent | fd7e746850372750efd42690aac25cbf32d9b5b4 (diff) |
Create HTTP responses with the stream that they will be sent to, for 100
Continue support.
-rw-r--r-- | lib/httpserver/HTTPServer.cpp | 8 | ||||
-rw-r--r-- | lib/httpserver/HTTPServer.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/httpserver/HTTPServer.cpp b/lib/httpserver/HTTPServer.cpp index fbdadfa7..b8b02249 100644 --- a/lib/httpserver/HTTPServer.cpp +++ b/lib/httpserver/HTTPServer.cpp @@ -152,7 +152,7 @@ void HTTPServer::Connection(SocketStream &rStream) } // Generate a response - HTTPResponse response; + HTTPResponse response(&rStream); try { Handle(request, response); @@ -183,7 +183,7 @@ void HTTPServer::Connection(SocketStream &rStream) } // Send the response (omit any content if this is a HEAD method request) - response.Send(rStream, request.GetMethod() == HTTPRequest::Method_HEAD); + response.Send(request.GetMethod() == HTTPRequest::Method_HEAD); } // Notify derived claases @@ -209,7 +209,7 @@ void HTTPServer::SendInternalErrorResponse(const char *Error, SocketStream &rStr "</body>\n</html>\n" // Generate the error page - HTTPResponse response; + HTTPResponse response(&rStream); response.SetResponseCode(HTTPResponse::Code_InternalServerError); response.SetContentType("text/html"); response.Write(ERROR_HTML_1, sizeof(ERROR_HTML_1) - 1); @@ -217,7 +217,7 @@ void HTTPServer::SendInternalErrorResponse(const char *Error, SocketStream &rStr response.Write(ERROR_HTML_2, sizeof(ERROR_HTML_2) - 1); // Send the error response - response.Send(rStream); + response.Send(); } diff --git a/lib/httpserver/HTTPServer.h b/lib/httpserver/HTTPServer.h index 9a86b04f..8009438d 100644 --- a/lib/httpserver/HTTPServer.h +++ b/lib/httpserver/HTTPServer.h @@ -46,7 +46,7 @@ public: // Created: 26/3/04 // // -------------------------------------------------------------------------- - virtual void Handle(const HTTPRequest &rRequest, HTTPResponse &rResponse) = 0; + virtual void Handle(HTTPRequest &rRequest, HTTPResponse &rResponse) = 0; // For notifications to derived classes virtual void HTTPConnectionOpening(); |