Re: mod_proxy, oooled backend connections and the keep-alive race condition

2013-10-17 Thread Thomas Eckert
Sorry for the delayed reply. At the moment I don't have time to look at the patch proposal in detail, sorry about that too. I'll get back to it soon, I hope. Pre-fetching 16K (or waiting for input filters to provide these) is not always a fast operation, and the case where the backend closes its

Re: error log providers, multiple vhosts, mod_syslog

2013-10-17 Thread Jan Kaluža
There's another problem with log providers and vhosts and I think I have no idea how to fix it without doing dirty hacks... The problem is with ap_open_logs function, which does following: 1. Main server log is opened (open_error_log()). If this log uses error log provider, s_main-error_log

RE: error log providers, multiple vhosts, mod_syslog

2013-10-17 Thread Plüm , Rüdiger , Vodafone Group
-Original Message- From: Jan Kaluža Sent: Donnerstag, 17. Oktober 2013 13:21 To: dev@httpd.apache.org Subject: Re: error log providers, multiple vhosts, mod_syslog There's another problem with log providers and vhosts and I think I have no idea how to fix it without doing dirty

Re: uds support

2013-10-17 Thread Daniel Ruggeri
On 10/16/2013 6:43 AM, Jim Jagielski wrote: One thing about lumping both the UDS path *and* the actual URL into the name field is that it really limits the size of both, such that, long term, I think it will come back and bite us. Since last night I've been working on a plan to simply create

Re: mod_proxy, oooled backend connections and the keep-alive race condition

2013-10-17 Thread Yann Ylavic
On Thu, Oct 17, 2013 at 11:36 AM, Thomas Eckert thomas.r.w.eck...@gmail.com wrote: Hence, why cannot mod_proxy_http prefetch the client's body *before* trying anything with the backend connection, and only if it's all good, connect (or reuse a connection to) the backend and then start

Re: svn commit: r1533100 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

2013-10-17 Thread Yann Ylavic
On Thu, Oct 17, 2013 at 5:02 PM, j...@apache.org wrote: Author: jim Date: Thu Oct 17 15:02:04 2013 New Revision: 1533100 URL: http://svn.apache.org/r1533100 Log: ap_proxy_strncpy should correctly handle src being NULL. Actually, apr_cpystrn() should as well... Modified:

Re: svn commit: r1533100 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

2013-10-17 Thread Jim Jagielski
Need to look, but at 1st blush it looks like an off-by-1 error there. On Oct 17, 2013, at 11:33 AM, Yann Ylavic ylavic@gmail.com wrote: Maybe ap_proxy_strncpy() could aso have no slow path with this change : Index: modules/proxy/proxy_util.c

Re: svn commit: r1533087 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h mod_proxy_balancer.c proxy_util.c

2013-10-17 Thread Jim Jagielski
This is uglier than creating a subpool... :) On Oct 17, 2013, at 12:10 PM, Yann Ylavic ylavic@gmail.com wrote: Maybe using the following macros could help to log worker's (full) name when no pool is available for ap_proxy_worker_name(). Regards, Index: modules/proxy/mod_proxy.h

Re: svn commit: r1533087 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h mod_proxy_balancer.c proxy_util.c

2013-10-17 Thread Yann Ylavic
On Thu, Oct 17, 2013 at 6:21 PM, Jim Jagielski j...@jagunet.com wrote: This is uglier than creating a subpool... :) Possibly ;) but with the pool being destroyed then... Regards.

Re: svn commit: r1533087 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h mod_proxy_balancer.c proxy_util.c

2013-10-17 Thread Yann Ylavic
On Thu, Oct 17, 2013 at 6:25 PM, Yann Ylavic ylavic@gmail.com wrote: On Thu, Oct 17, 2013 at 6:21 PM, Jim Jagielski j...@jagunet.com wrote: This is uglier than creating a subpool... :) Possibly ;) but with the pool being destroyed then... Something like : PROXY_DECLARE(char *)

Re: svn commit: r1533087 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h mod_proxy_balancer.c proxy_util.c

2013-10-17 Thread Jim Jagielski
That's why I chose what I did... It's only needed once and the pool is around. But yeah, it may be better. On Oct 17, 2013, at 12:25 PM, Yann Ylavic ylavic@gmail.com wrote: On Thu, Oct 17, 2013 at 6:21 PM, Jim Jagielski j...@jagunet.com wrote: This is uglier than creating a subpool... :)

Re: svn commit: r1533100 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

2013-10-17 Thread Yann Ylavic
On Thu, Oct 17, 2013 at 6:19 PM, Jim Jagielski j...@jagunet.com wrote: Need to look, but at 1st blush it looks like an off-by-1 error there. When source length = dlen, apr_cpystrn() ensures dst[0:dlen - 1] == src[0:dlen - 1], hence off-by-1 is useless. Regards. On Oct 17, 2013, at

Re: svn commit: r1533100 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

2013-10-17 Thread Yann Ylavic
On Thu, Oct 17, 2013 at 6:43 PM, Yann Ylavic ylavic@gmail.com wrote: On Thu, Oct 17, 2013 at 6:19 PM, Jim Jagielski j...@jagunet.com wrote: Need to look, but at 1st blush it looks like an off-by-1 error there. When source length = dlen, apr_cpystrn() ensures dst[0:dlen - 1] ==

Re: svn commit: r1533100 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

2013-10-17 Thread Jim Jagielski
Look at it this way: if thelen ! dlen then its either the same or greater. Also, thelen is basically the strlen of the string copied. If it is the size of src, then we're fine. So the check SHOULD be if ((thelen dlen-1) || !src[thelen]) { using dlen we could blow past the actual bounds

Re: svn commit: r1533100 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

2013-10-17 Thread Yann Ylavic
You're absolutely right, I mixed everything on this one. On Thu, Oct 17, 2013 at 7:16 PM, Jim Jagielski j...@jagunet.com wrote: Look at it this way: if thelen ! dlen then its either the same or greater. Also, thelen is basically the strlen of the string copied. If it is the size of src,

Re: svn commit: r1533087 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h mod_proxy_balancer.c proxy_util.c

2013-10-17 Thread Yann Ylavic
On Thu, Oct 17, 2013 at 4:10 PM, j...@apache.org wrote: Author: jim Date: Thu Oct 17 14:10:43 2013 New Revision: 1533087 @@ -2087,12 +2089,9 @@ PROXY_DECLARE(int) ap_proxy_acquire_conn (*conn)-close = 0; (*conn)-inreslist = 0; -if (worker-s-uds) { +if

Re: svn commit: r1533087 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h mod_proxy_balancer.c proxy_util.c

2013-10-17 Thread Jim Jagielski
For sure the (*conn)-pool is recycled more often... On Oct 17, 2013, at 3:52 PM, Yann Ylavic ylavic@gmail.com wrote: On Thu, Oct 17, 2013 at 4:10 PM, j...@apache.org wrote: Author: jim Date: Thu Oct 17 14:10:43 2013 New Revision: 1533087 @@ -2087,12 +2089,9 @@ PROXY_DECLARE(int)

Setting up a connection for the lifetime of a worker thread

2013-10-17 Thread Rajalakshmi Iyer
Hello, I want to query a third-party data store from within an Apache module for each HTTP request. Currently, I am having to create a pool of connections to this third party store and checkout connections from this pool. Is it possible to setup Apache to create connection to this data store