summaryrefslogtreecommitdiff
path: root/src/libfast/request.c
diff options
context:
space:
mode:
authorRené Mayrhofer <rene@mayrhofer.eu.org>2011-03-05 09:20:09 +0100
committerRené Mayrhofer <rene@mayrhofer.eu.org>2011-03-05 09:20:09 +0100
commit568905f488e63e28778f87ac0e38d845f45bae79 (patch)
treed9969a147e36413583ff4bc75542d34c955f8823 /src/libfast/request.c
parentf73fba54dc8b30c6482e1e8abf15bbf455592fcd (diff)
downloadvyos-strongswan-568905f488e63e28778f87ac0e38d845f45bae79.tar.gz
vyos-strongswan-568905f488e63e28778f87ac0e38d845f45bae79.zip
Imported Upstream version 4.5.1
Diffstat (limited to 'src/libfast/request.c')
-rw-r--r--src/libfast/request.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libfast/request.c b/src/libfast/request.c
index 16c1ae583..a3db70e82 100644
--- a/src/libfast/request.c
+++ b/src/libfast/request.c
@@ -120,7 +120,7 @@ static char *getenv_cb(void *null, const char *key)
private_request_t *this = (private_request_t*)thread_this->get(thread_this);
value = FCGX_GetParam(key, this->req.envp);
- return value ? strdup(value) : NULL;
+ return strdupnull(value);
}
/**
@@ -204,6 +204,14 @@ static char* get_query_data(private_request_t *this, char *name)
}
/**
+ * Implementation of request_t.get_env_var.
+ */
+static char* get_env_var(private_request_t *this, char *name)
+{
+ return FCGX_GetParam(name, this->req.envp);
+}
+
+/**
* Implementation of request_t.read_data.
*/
static int read_data(private_request_t *this, char *buf, int len)
@@ -415,6 +423,7 @@ request_t *request_create(int fd, bool debug)
this->public.add_cookie = (void(*)(request_t*, char *name, char *value))add_cookie;
this->public.get_cookie = (char*(*)(request_t*,char*))get_cookie;
this->public.get_query_data = (char*(*)(request_t*, char *name))get_query_data;
+ this->public.get_env_var = (char*(*)(request_t*, char *name))get_env_var;
this->public.read_data = (int(*)(request_t*, char*, int))read_data;
this->public.session_closed = (bool(*)(request_t*))session_closed;
this->public.close_session = (void(*)(request_t*))close_session;