You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2001/04/11 01:20:48 UTC

[PATCH] thread-safe fix for mod_proxy

Hi all,

The attached patch makes mod_proxy thread safe, and at the same time
fixes some nasty behavior caused by the non-thread-safeness of the
existing mod_proxy code.

Like last time, the proxy needs to attach the downstream conn_rec to the
upstream conn_rec so that keepalives can be supported. In the mean time
though, it has become clear that this link is necessary for mod_proxy to
work.

It's been suggested that the permanent solution is to allow a mechanism
where modules can save per-connection data other than strings (c->notes)
alongside the conn_rec, but in the meantime we need a temporary solution
so that mod_proxy can work.

The first patch is for httpd.h, the second for mod_proxy.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: [PATCH] thread-safe fix for mod_proxy

Posted by Graham Leggett <mi...@sharp.fm>.
Eli Marmor wrote:

> What is the status of 1.3.20-dev proxying ?
> Are all of these patches needed for 1.3 too?
> Is the progress with 2.0 (except for the brigade stuff and all the things
> specific for 2.0) back ported to 1.3?
> After all, things like multi-threading exist in 1.3 too (for WIN32, for
> example).

The development on the v2.0 mod_proxy is heavily involved with filters,
buckets and brigades, so it wouldn't be practical to backport everything
to v1.3.

In addition, all caching capabilities have been stripped from mod_proxy
entirely - making a *way* simpler module that's a lot easier to
understand and maintain. The cache functionality is being moved to a
separate module and turned into a filter - work will start when I get
mod_proxy out the door :)

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: [PATCH] thread-safe fix for mod_proxy

Posted by Chuck Murcko <ch...@topsail.org>.
On Wednesday, April 11, 2001, at 04:16 AM, Eli Marmor wrote:

> By the way (and sorry for being too lazy to look at the CVS...):
>
> What is the status of 1.3.20-dev proxying ?

HTTP/1.1 patch is under test

> Are all of these patches needed for 1.3 too?

no, there is a separate patch for 1.3.x.
see http://dev.apache.org/dist/

> Is the progress with 2.0 (except for the brigade stuff and all the 
> things
> specific for 2.0) back ported to 1.3?

The patch provides an HTTP/1.1 proxy server for 1.3.x.

> After all, things like multi-threading exist in 1.3 too (for WIN32, for
> example).
>

That would be httpd-2.0. Development effort shifted to there a long time 
ago.

Chuck

Re: [PATCH] thread-safe fix for mod_proxy

Posted by Eli Marmor <ma...@elmar.co.il>.
By the way (and sorry for being too lazy to look at the CVS...):

What is the status of 1.3.20-dev proxying ?
Are all of these patches needed for 1.3 too?
Is the progress with 2.0 (except for the brigade stuff and all the things
specific for 2.0) back ported to 1.3?
After all, things like multi-threading exist in 1.3 too (for WIN32, for
example).

Thanks,
-- 
Eli Marmor
marmor@netmask.it
CTO, Founder
Netmask (El-Mar) Internet Technologies Ltd.
__________________________________________________________
Tel.:   +972-9-766-1020          8 Yad-Harutzim St.
Fax.:   +972-9-766-1314          P.O.B. 7004
Mobile: +972-50-23-7338          Kfar-Saba 44641, Israel

Re: [PATCH] thread-safe fix for mod_proxy

Posted by Graham Leggett <mi...@sharp.fm>.
"Roy T. Fielding" wrote:

> Nope, you don't know it is the origin server (and origin isn't sufficient
> anyway, since the user agent is the origin of a request message).
> 
>    c->outbound_server
> 
> would be the most accurate name, and would make sense to be NULL when
> we are the origin.

Ok... I've attached a new set of patches.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: [PATCH] thread-safe fix for mod_proxy

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
> > r->connection is the inbound conn_rec.
> 
> The original filters conversion on mod_proxy used 'conn_rec *origin' -
> how about c->origin?

Nope, you don't know it is the origin server (and origin isn't sufficient
anyway, since the user agent is the origin of a request message).

   c->outbound_server

would be the most accurate name, and would make sense to be NULL when
we are the origin.

....Roy


Re: [PATCH] thread-safe fix for mod_proxy

Posted by Graham Leggett <mi...@sharp.fm>.
"Roy T. Fielding" wrote:

> downstream is the wrong name -- see how it is used in the HTTP spec.
> Every data stream has an upstream (where data is coming from) and
> a downstream (where data is going to be forwarded), so every connection
> consists of two streams: an upstream and a downstream.  What you want
> is to differentiate between the inbound direction (towards the origin
> server) and the outbound direction (towards the user agent).
> 
> r->connection is the inbound conn_rec.

The original filters conversion on mod_proxy used 'conn_rec *origin' -
how about c->origin?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: [PATCH] thread-safe fix for mod_proxy

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
downstream is the wrong name -- see how it is used in the HTTP spec.
Every data stream has an upstream (where data is coming from) and
a downstream (where data is going to be forwarded), so every connection
consists of two streams: an upstream and a downstream.  What you want
is to differentiate between the inbound direction (towards the origin
server) and the outbound direction (towards the user agent).

r->connection is the inbound conn_rec.

....Roy