Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / apps / JAWS / server / HTTP_Response.h
blobf6e4c3807d266dd38897b9a505e365d0efa12252
1 /* -*- c++ -*- */
3 //=============================================================================
4 /**
5 * @file HTTP_Response.h
7 * @author James Hu
8 */
9 //=============================================================================
12 #ifndef HTTP_RESPONSE_H
13 #define HTTP_RESPONSE_H
15 class JAWS_IO;
16 class HTTP_Request;
18 /**
19 * @class HTTP_Response
21 * @brief Abstraction for HTTP responses.
23 * Provides an encapsulation of responses to HTTP requests.
24 * For instance, given an HTTP GET request, it will produce
25 * header and body suitable for returning to the client who made
26 * the request.
28 class HTTP_Response
30 public:
31 HTTP_Response (JAWS_IO &io,
32 HTTP_Request &request);
33 HTTP_Response (HTTP_Request &request, JAWS_IO &io);
34 ~HTTP_Response ();
36 /// This is called by the handler to initiate a response.
37 void process_request ();
39 /// This returns an error response for cases where there is a problem
40 /// with the request, logging the log_message.
41 void error_response (int status,
42 const char *log_message);
44 private:
45 /// Called by process_request when the request is a normal request.
46 void normal_response ();
48 /// Called by process_request when the request is a cgi request.
49 void cgi_response ();
51 private:
52 /// static version of process_request, just in case.
53 static void process_request (HTTP_Response &response);
55 /// creates the appropriate header information for responses.
56 void build_headers ();
58 private:
59 /// The IO and Request objects associated with this re
60 JAWS_IO &io_;
61 HTTP_Request &request_;
63 #if defined (ACE_JAWS_BASELINE)
64 char *HTTP_HEADER;
65 #else
66 const char *HTTP_HEADER;
67 #endif
68 /// HTTP Headers and trailers.
69 const char *HTTP_TRAILER;
70 int HTTP_HEADER_LENGTH;
71 int HTTP_TRAILER_LENGTH;
74 #endif /* HTTP_RESPONSE_H */