[Zope] Re: REMOTE_ADDR

Dieter Maurer dieter@handshake.de
Sun, 25 Aug 2002 08:00:25 +0200


Please stay on the list.

KevinL writes:
 > Your patch to add support for REMOTE_ADDR to VHM - I can apply it ok to
 > VHM, but looking at it, it sets a value in REQUEST.environ - are there
 > threading issues with that at all?
REQUEST describes one request.

With the standard Zope threading model,
only one thread is responsible to handle one request. Unless you
do very special things, there are no threading issues associated
with REQUEST.

Even when you do very special things, the VHM patch should be
unaffected, because it runs very early, usually before your
application gets any chance to intervene.

 > Is environ shared across multiple
 > requests,
No. It is local data inside "REQUEST".

 > and might multiple requests at once munge that up a bit?
 > Am I
 > safer dumping the value into REQUEST itself?
There is no difference with respect to safety.

But "REQUEST.environ" is where "REMOTE_ADDR" is usually placed.
You may get surprises when you put it elsewhere...


Dieter