diff options
author | Stefan Bühler <stbuehler@web.de> | 2009-04-15 22:33:34 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2009-04-15 22:33:34 +0000 |
commit | 21a321071af5830491e7c925db1553bc5a3343a8 (patch) | |
tree | a0af321be9922348dcb60f63848b65fd9e4842f0 | |
parent | 61d4bead3b48837d9e206076a4547578e5d97672 (diff) | |
download | lighttpd-git-21a321071af5830491e7c925db1553bc5a3343a8.tar.gz |
mod_magnet: Add env["request.remote-ip"] (fixes #1740)
git-svn-id: svn+ssh://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2473 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/mod_magnet.c | 3 |
2 files changed, 4 insertions, 0 deletions
@@ -22,6 +22,7 @@ NEWS * Add revision number to package version for svn/git checkouts * Use server.tag for SERVER_SOFTWARE if configured (fixes #357) * Fix trailing zero char in REQUEST_URI after "strip-request-uri" in mod_fastcgi + * mod_magnet: Add env["request.remote-ip"] (fixes #1740) - 1.4.22 - 2009-03-07 * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533) diff --git a/src/mod_magnet.c b/src/mod_magnet.c index 86b37ac9..6339753a 100644 --- a/src/mod_magnet.c +++ b/src/mod_magnet.c @@ -365,6 +365,7 @@ typedef struct { MAGNET_ENV_REQUEST_METHOD, MAGNET_ENV_REQUEST_URI, MAGNET_ENV_REQUEST_ORIG_URI, + MAGNET_ENV_REQUEST_REMOTE_IP, MAGNET_ENV_REQUEST_PROTOCOL } type; } magnet_env_t; @@ -387,6 +388,7 @@ static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *k { "request.method", MAGNET_ENV_REQUEST_METHOD }, { "request.uri", MAGNET_ENV_REQUEST_URI }, { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI }, + { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP }, { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL }, { NULL, MAGNET_ENV_UNSET } @@ -420,6 +422,7 @@ static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *k break; case MAGNET_ENV_REQUEST_URI: dest = con->request.uri; break; case MAGNET_ENV_REQUEST_ORIG_URI: dest = con->request.orig_uri; break; + case MAGNET_ENV_REQUEST_REMOTE_IP: dest = con->dst_addr_buf; break; case MAGNET_ENV_REQUEST_PROTOCOL: buffer_copy_string(srv->tmp_buf, get_http_version_name(con->request.http_version)); dest = srv->tmp_buf; |