RE: squid 2.6-rproxy: locrewrite.c bug

From: Jeffrey D. Wheelhouse <jdw_list@dont-contact.us>
Date: Tue, 18 Jun 2002 17:52:47 -0500

I've run into a snag with the new-style cbdata handling in locrewrite.c.

The pre-patch locationRewriteHandleReply:
65: valid = cbdataValid(r->data);
66: cbdataUnlock(r->data);
67: if (valid)
68: r->handler(r->data, reply);
69: locationRewriteStateFree(r);

The updated code:

65: valid = cbdataReferenceValid(r->data);
66: cbdataReferenceDone(r->data);
67: if (valid)
68: r->handler(r->data, reply);
69: locationRewriteStateFree(r);

This promptly leads to cores, because cbdataReferenceDone wipes out
r->data. Duh. I feel very silly for not realizing this the first time.

I am testing a patch (attached) that yields:

64: if (cbdataReferenceValid(r->data))
65: r->handler(r->data, reply);
66: cbdataReferenceDone(r->data);
67: locationRewriteStateFree(r);

However, the whole point of "valid" seems to be to do the unreference
before calling r->handler, and I'm not sure why. So this may not be the
correct fix.

This patch should also be tabbed correctly (finally).

I also have the read_ahead_gap config patch done, but nontrivial testing
of that has been gated by this issue until now. If this is a good fix,
the read_ahead_gap patch will be done testing Thursday.

Thanks,
Jeff

--
NearlyFreeSpeech.NET 
$1/1GB Web Hosting, no minimums, no monthly fees, no kidding.
http://www.nearlyfreespeech.net/

Received on Tue Jun 18 2002 - 16:52:32 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:41 MST