[PATCH] Bug 1961 pt1: Use URL object in HttpRequest and cleanup scheme handling

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sat, 26 Apr 2014 19:59:42 +1200

This attached patch begins the cleanup to resolve bug 1961 URL handling
issues:

Replace the HttpMsg::protocol member (only used by HttpRequest) with a
class URL member HttpRequest::url. To do this we adjust the class URL
scheme_ member to be mutable via the makeScheme() setter, and add a
clear() method to reset its internal state. These are necessary for
HttpRequest init() and initHTTP() mechanisms, but fiddling with the
scheme should be avoided as much as possible.

Remove the hack of forcing internal requests to http:// for processing
and cache lookup, then to internal:// for FwdState. Instead use the
available flags.internal for requests identified to be served by this proxy.

Drop the non-standard and now meaningless "internal://" scheme.

Add debugging to display what internal indicators are detected and when
the internal*() server and CacheManager are used by FwdState.

Also document HttpMsg::http_ver which is a copy of the HTTP-Version
field in the "on-wire" message syntax. It is unrelated to the socket
transport protocol and the URL scheme protocol.
 There may be code still using it incorrectly as equivalent for the URL
scheme. Have not done a detailed check at this point, that is future work.

Other future work:
 * move the HttpRequest login, host, hostIsNumeric, urlpath members into
URL class.
 * move the old url*() functions to members of class URL

Amos

Received on Sat Apr 26 2014 - 08:00:00 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 27 2014 - 12:00:14 MDT