Mailing List Archive

Observations on teh effects of recent changes

I still having difficulty with requests being backhanded multiple times with
the current CVS vesion, so I had a look at the recent code changes. First
let me admit, I am a neophyte C programmer, but some of the recent changes,
and the differences I am seeing in my logs, gave me an idea.

Some of the changes (as shown below) attempt to prevent the adding of
"backhand:" multiple times to the URI. I was seeing this in my logs, logged
lines with many "backhand:" up until Friday morning when I switched to the
CVS version. I also turned off SelfRedirect at this point, this may explain
it also.

Now I see only 1 flag added onto the URI, but this does not stop it from
being backhanded multiple times. I realize that the lines below are in the
"else" section of a block and the test for the "BackhandProxied" by header
should have already verified that it had not been backhanded before, but
this seems to not be the case. The fact that multiple "backhand:" flags can
get added and require an enclosing test, I would have thought that the
(r->handler = "backhand-redirection";) and the (r->content_type =
"backhand/redirect";) lines should also be protected with an IF test
*BEFORE* the flag is added to the URI to prevent the request from being
backhanded again?

=== old mod_backhand.c ===
r->uri = ap_pstrcat(r->pool, "backhand:", r->uri, NULL);
r->filename = ap_pstrdup(r->pool, r->uri);

=== new mod_backhand.c ===
if(strncmp(r->uri, "backhand:", 9))
r->uri = ap_pstrcat(r->pool, "backhand:", r->uri, NULL)
if(strncmp(r->filename, "backhand:", 9))
r->filename = ap_pstrcat(r->pool, "backhand:", r->filename,
r->handler = "backhand-redirection";

Does this make any sense?

I also noticed one other thing, in the server-status snapshots I posted on
the m_b_h users list, the source IP was showing the internal nodes address,
rather than the actual machine that was making the request. The actual
address ( showed up on 1 request, but the cascaded requests
all show the node addresses ( Hmmm the address seems to be
getting trashed.

Dennis Cartier

P.S. I am posting this to the development list as it is more development
related, and I thought you might like to see something other than the
Nigerian money scam for a change :)

The man with tremendous wealth is a paradox: he has to be smart enough to
get it, yet stupid enough to want it. - Chesterton