We added the following code snippet in our connection filter. If there
is a better way please let me know as I would like to switch our code
to use it (I believe we require pre_connection instead of
process_connection so we can't use Stefan's suggestion):

// If this is not an inbound connection, for example one generated
// by mod_proxy, then do not filter it.
if (c->local_addr->port != c->base_server->port) {
  return OK;
}

On Sun, Aug 22, 2010 at 6:15 AM, Stefan Fritsch <[email protected]> wrote:
> On Sunday 22 August 2010, Graham Leggett wrote:
>> I have a connection filter based on mod_dumpio that reads data
>> coming into and out of the server, however this filter gets
>> inserted twice - once normally within the normal filter stack, and
>> a second time within the proxy's backend connection filter stack.
>>
>> I need the filter to be able to distinguish whether it is running
>> normally or through a proxy, and a look in the mod_proxy code
>> doesn't show a clear marker to indicate which conn_rec structure
>> is which.
>
> I have encountered this problem before. In mod_reqtimeout, I have used
> the process_connection hook for inserting the filter insteaad of the
> pre_connection hook, in order to avoid to insert it on backend
> connections.
>
> In server/log.c, I have checked if c->sbh is NULL. I am not sure this
> is 100% reliable, but it is good enough to decide wether to log an
> address as "client" or "remote".
>
> If there is no better method, maybe we should create one? Like adding
> a field to the conn_rec.
>

Reply via email to