]> git.ipfire.org Git - thirdparty/squid.git/commit - src/http.cc
Update Http::ProtocolVersion() to initializer functions
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 11 Dec 2014 08:35:32 +0000 (00:35 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 11 Dec 2014 08:35:32 +0000 (00:35 -0800)
commit2592bc708595793aa1635c21e80f4f9712000e76
tree33db65c389675d3db068b0090d795f176eda22ba
parent076361789d377ffad125313fbfc32ed31922310b
Update Http::ProtocolVersion() to initializer functions

The Http::ProtocolVersion(*) does not work sufficiently well as a class
hierarchy.

Convert Http::ProtocolVersion to two functions:

* Http::ProtocolVersion() providing the default Squid HTTP version
level, and

* Http::ProtocolVersion(unsigned, unsigned) providing the HTTP version
details for the given level.

NP: using two overloaded functions instead of one with default
parameter values because with HTTP/0.x and HTTP/2.x we cannot safely
default just the minor value. ie. using two functions prevents
mistakenly using HTTP/2.1, HTTP/0.1 or HTTP/1.0 if the second
parameter is omitted.

All variables must now be of type AnyP::ProtocolVersion, and should be
constructed from an appropriate Foo::ProtocolVersion() function.
13 files changed:
src/AccessLogEntry.h
src/HttpMsg.cc
src/HttpMsg.h
src/HttpReply.cc
src/client_side_reply.cc
src/client_side_request.cc
src/ftp/Elements.cc
src/http.cc
src/http/ProtocolVersion.h
src/http/StatusLine.cc
src/http/StatusLine.h
src/icmp/net_db.cc
src/servers/HttpServer.cc