From c295d0eb4b11a024d1607f6a80275f372c345c08 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 26 Sep 2007 14:02:21 +0000 Subject: refactored strongswan manager removed buggy request parsing code, use ClearSilvers CGI kit instead fixed CHILD_SA listing in manager (needs better design) using secure XML communication through unix sockets removed images with questionable (non-GPL) license --- src/manager/lib/request.h | 64 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 5 deletions(-) (limited to 'src/manager/lib/request.h') diff --git a/src/manager/lib/request.h b/src/manager/lib/request.h index 852238a1d..e6fd71e71 100644 --- a/src/manager/lib/request.h +++ b/src/manager/lib/request.h @@ -23,8 +23,8 @@ #ifndef REQUEST_H_ #define REQUEST_H_ - #include +#include typedef struct request_t request_t; @@ -34,6 +34,14 @@ typedef struct request_t request_t; */ struct request_t { + /** + * @brief Add a cookie to the reply (Set-Cookie header). + * + * @param name name of the cookie to set + * @param value value of the cookie + */ + void (*add_cookie)(request_t *this, char *name, char *value); + /** * @brief Get a cookie the client sent in the request. * @@ -50,12 +58,57 @@ struct request_t { char* (*get_path)(request_t *this); /** - * @brief Get a post variable included in the request. + * @brief Get the base path of the application. + * + * @return base path + */ + char* (*get_base)(request_t *this); + + /** + * @brief Get a post/get variable included in the request. * - * @param name name of the POST variable + * @param name name of the POST/GET variable * @return value, NULL if not found */ - char* (*get_post_data)(request_t *this, char *name); + char* (*get_query_data)(request_t *this, char *name); + + /** + * @brief Redirect the client to another location. + * + * @param location location to redirect to + */ + void (*redirect)(request_t *this, char *location); + + /** + * @brief Set a template value. + * + * @param key key to set + * @param value value to set key to + */ + void (*set)(request_t *this, char *key, char *value); + + /** + * @brief Set a template value using format strings. + * + * Format string is in the form "key=value", where printf like format + * substitution occurs over the whole string. + * + * @param format printf like format string + * @param ... variable argument list + */ + void (*setf)(request_t *this, char *format, ...); + + /** + * @brief Render a template. + * + * The render() function additionally sets a HDF variable "base" + * which points to the root of the web application and allows to point to + * other targets without to worry about path location. + * + * @param template clearsilver template file location + * @return rendered template string + */ + void (*render)(request_t *this, char *template); /** * @brief Destroy the request_t. @@ -67,7 +120,8 @@ struct request_t { * @brief Create a request from the fastcgi struct. * * @param request the FCGI request + * @param debug no stripping, no compression, timing information */ -request_t *request_create(FCGX_Request *request); +request_t *request_create(FCGX_Request *request, bool debug); #endif /* REQUEST_H_ */ -- cgit v1.2.3