lip service to http/0.9

This commit is contained in:
David Rose 2002-10-14 22:36:53 +00:00
parent dba02d9705
commit 57c8314258
3 changed files with 8 additions and 2 deletions

View File

@ -163,6 +163,9 @@ get_username(const string &server, const string &realm) const {
string HTTPClient::
get_http_version_string() const {
switch (_http_version) {
case HV_09:
return "HTTP/0.9";
case HV_10:
return "HTTP/1.0";
@ -191,6 +194,8 @@ parse_http_version_string(const string &version) {
return HV_10;
} else if (version == "HTTP/1.1") {
return HV_11;
} else if (version.substr(0, 6) == "HTTP/0") {
return HV_09;
} else {
return HV_other;
}

View File

@ -64,6 +64,7 @@ PUBLISHED:
string get_username(const string &server, const string &realm) const;
enum HTTPVersion {
HV_09, // HTTP 0.9 or older
HV_10, // HTTP 1.0
HV_11, // HTTP 1.1
HV_other,

View File

@ -228,8 +228,8 @@ is_regular_file() const {
////////////////////////////////////////////////////////////////////
bool HTTPDocument::
will_close_connection() const {
if (get_http_version() == HTTPClient::HV_10) {
// HTTP 1.0 always closes.
if (get_http_version() < HTTPClient::HV_11) {
// pre-HTTP 1.1 always closes.
return true;
}