Subversion Repositories heating

Rev

Rev 17 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 19
Line 34... Line 34...
34
		/**
34
		/**
35
	 	* Handles given request.
35
	 	* Handles given request.
36
	 	*/
36
	 	*/
37
		virtual int handleRequest(struct MHD_Connection* connection,
37
		virtual int handleRequest(struct MHD_Connection* connection,
38
							  const char *url, const char *method, const char *upload_data,
38
							  const char *url, const char *method, const char *upload_data,
39
							  size_t *upload_data_size) = 0;
39
							  size_t *upload_data_size, void **ptr) = 0;
40
};
40
};
41
 
41
 
42
/**
42
/**
43
 * The dynamic controller is a controller for creating user defined pages.
43
 * The dynamic controller is a controller for creating user defined pages.
44
 */
44
 */
Line 50... Line 50...
50
		/**
50
		/**
51
	 	* User defined http response.
51
	 	* User defined http response.
52
	 	*/
52
	 	*/
53
		virtual void createResponse(struct MHD_Connection *connection,
53
		virtual void createResponse(struct MHD_Connection *connection,
54
        			const char *url, const char *method, const char *upload_data,
54
        			const char *url, const char *method, const char *upload_data,
55
        			size_t *upload_data_size, std::stringstream& response) = 0;
55
        			size_t *upload_data_size, std::stringstream& response, void **ptr) = 0;
56
	
56
	
57
		virtual int handleRequest(struct MHD_Connection* connection,
57
		virtual int handleRequest(struct MHD_Connection* connection,
58
							  const char *url, const char *method, const char *upload_data,
58
							  const char *url, const char *method, const char *upload_data,
59
							  size_t *upload_data_size)
59
							  size_t *upload_data_size, void **ptr)
60
		{
60
		{
61
			std::stringstream response_string;
61
			std::stringstream response_string;
62
			createResponse(connection, url, method, upload_data, upload_data_size, response_string);
62
			createResponse(connection, url, method, upload_data, upload_data_size, response_string, ptr);
63
 
63
 
64
			//Send response.
64
			//Send response.
65
			struct MHD_Response *response = MHD_create_response_from_buffer(strlen(response_string.str().c_str()),
65
			struct MHD_Response *response = MHD_create_response_from_buffer(strlen(response_string.str().c_str()),
66
															(void *)response_string.str().c_str(), MHD_RESPMEM_MUST_COPY);
66
															(void *)response_string.str().c_str(), MHD_RESPMEM_MUST_COPY);
67
			int ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
67
			int ret = MHD_queue_response(connection, MHD_HTTP_OK, response);