Feature #1740

remoteip support for mod_magnet

Added by Anonymous over 5 years ago. Updated about 5 years ago.

Status:FixedStart date:
Priority:NormalDue date:
Assignee:icy% Done:

100%

Category:mod_magnet
Target version:1.4.23
Missing in 1.5.x:

Description

there is no way to getting remote client ip from mod_magnet so i added this small patch to mod_magnet.

using from lua is same as other env variables
lighty.envrequest.remoteip

--- lighttpd/src/mod_magnet.c 2008-08-01 16:31:00.000000000 0300
++ mod_magnet.c 2008-08-01 16:30:47.000000000 0300
@ -392,6 +392,7 @
MAGNET_ENV_REQUEST_METHOD,
MAGNET_ENV_REQUEST_URI,
MAGNET_ENV_REQUEST_ORIG_URI,
MAGNET_ENV_REQUEST_REMOTEIP,
MAGNET_ENV_REQUEST_PROTOCOL
} type;
} magnet_env_t;
@ -414,6 +415,7 @ { "request.method", MAGNET_ENV_REQUEST_METHOD }, { "request.uri", MAGNET_ENV_REQUEST_URI }, { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
+ { "request.remoteip", MAGNET_ENV_REQUEST_REMOTEIP }, { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },

{ NULL, MAGNET_ENV_UNSET }
@ -447,6 +449,7 @
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_REMOTEIP: 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;

-- Taylan Karaoglu

remoteip.patch Magnifier - mod_magnet remoteip patch -- Taylan Karaoglu (1.02 KB) Anonymous, 2008-08-01 12:39


Related issues

Duplicated by Feature #1344: [PATCH] small tweak to inject remote ips into mod_magnet ... Fixed

Associated revisions

Revision 2473
Added by stbuehler about 5 years ago

mod_magnet: Add env["request.remote-ip"] (fixes #1740)

History

#1 Updated by indeyets about 5 years ago

  • Status changed from New to Patch Pending
  • Assignee changed from jan to icy
  • Target version changed from 1.5.0 to 1.4.22
  • % Done changed from 0 to 100

this one is simple and has patch.

#2 Updated by stbuehler about 5 years ago

  • Target version changed from 1.4.22 to 1.4.23

#3 Updated by stbuehler about 5 years ago

  • Status changed from Patch Pending to Fixed

Applied in changeset r2473.

Also available in: Atom