int
httpMsgIsPersistent(HttpVersion const &http_ver, const HttpHeader * hdr)
{
- if ((http_ver.major >= 1) && (http_ver.minor >= 1)) {
+ if (http_ver > HttpVersion(1, 0)) {
/*
* for modern versions of HTTP: persistent unless there is
* a "Connection: close" header.
return ((this->major != that.major) || (this->minor != that.minor));
}
+ bool operator <(const HttpVersion& that) const {
+ return (this->major < that.major ||
+ (this->major == that.major && this->minor < that.minor));
+ }
+
+ bool operator >(const HttpVersion& that) const {
+ return (this->major > that.major ||
+ (this->major == that.major && this->minor > that.minor));
+ }
+
+ bool operator <=(const HttpVersion& that) const {
+ return !(*this > that);
+ }
+
+ bool operator >=(const HttpVersion& that) const {
+ return !(*this < that);
+ }
};
#endif /* SQUID_HTTPVERSION_H */