On Wed, 18 May 2011 10:09:37 -0600, Alex Rousskov wrote:
On 05/18/2011 10:00 AM, Amos Jeffries wrote:

This canonical change has been discussed previously. There is one other incorrect setting of HttpRequest::canonical in icap/ModXact.cc, but that must handle a const input which urlCanonical() function does not yet
handle.

To fix that, urlCanonical(request) should become a constant HttpRequest method. Is there an XXX about this in icap/ModXact.cc? If not, please
add.

I'm not so sure. Making it constant voids the caching speed benefit. The
existing xstrdup() is fine in the name of speed.


The HttpRequest::urlCanonical() method should be constant. The canonical
data member should be mutable (because it is just a cached computed
value). Thus, urlCanonical() can compute canonical value if needed (and other HttpRequest methods can clear canonical if needed). This way you
get both const-correctness and caching speed.


Oh, forgot mutable. Thanks.

Amos

Reply via email to