mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
lip service to http/0.9
This commit is contained in:
parent
dba02d9705
commit
57c8314258
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user