Project

General

Profile

Actions

Feature #1740

closed

remoteip support for mod_magnet

Added by Anonymous over 16 years ago. Updated over 15 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_magnet
Target version:
ASK QUESTIONS IN Forums:

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


Files

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

Related issues 1 (0 open1 closed)

Has duplicate Feature #1344: [PATCH] small tweak to inject remote ips into mod_magnet to allow htaccess-style IP filteringFixedActions
Actions #1

Updated by indeyets almost 16 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.

Actions #2

Updated by stbuehler almost 16 years ago

  • Target version changed from 1.4.22 to 1.4.23
Actions #3

Updated by stbuehler over 15 years ago

  • Status changed from Patch Pending to Fixed

Applied in changeset r2473.

Actions

Also available in: Atom