Project

General

Profile

Bug #1976

geoip env + lua

Added by IrPr about 10 years ago. Updated almost 3 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
mod_magnet
Target version:
Start date:
2009-05-07
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

Hi there

mod_geoip environments are not recognized in lua scripts using mod_magnet

lighttpd.conf:

@server.modules += ( "mod_geoip" )

geoip.db-filename = "/etc/GeoIP.dat"

server.modules += ( "mod_magnet" )

magnet.attract-physical-path-to = ( "/etc/lighttpd/mooz.lua" )@

mooz.lua:

lighty.header["Location"] = "http://woot?" .. lighty.env["GEOIP_COUNTRY_CODE"]
return 302

error log:

2009-05-07 10:00:14: (mod_magnet.c.765) lua_pcall(): /etc/lighttpd/mooz.lua:5: attempt to concatenate field 'GEOIP_COUNTRY_CODE' (a nil value)

As you see mod_geoip is loaded before mod_magnet, but mod_geoip is not setting the env variables properly, or maybe mod_magnet couldn't use them


Related issues

Related to Feature #1546: Enhancements for mod_geoipWontfix

Actions

History

#1

Updated by IrPr about 10 years ago

  • Target version changed from 1.4.x to 1.5.0
#2

Updated by stbuehler about 10 years ago

  • Status changed from New to Invalid

I still don't see a mod_geoip upstream. and lighty.env is not the environment (it should be renamed "lighty.req-data" or something like that).

#3

Updated by natethelen almost 10 years ago

I am also seeing this using fast-cgi and flup (python). I have traced it back to the raw socket read and none of the GEOIP_* FCGI_PARAMS are being sent through. What is weird is that they are passed through to PHP when run via fast-cgi with all else equal on the same box

#4

Updated by gstrauss almost 3 years ago

#5

Updated by gstrauss almost 3 years ago

mod_geoip currently hooks subrequest_start, where the geoip info is then available to dynamic handlers such as mod_cgi, mod_fastcgi, mod_scgi.

mod_geoip in the subrequest_start hook runs after mod_magnet, which runs in earlier hooks in the request.

See #1546 for further explanation.

Also available in: Atom