mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -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::
|
string HTTPClient::
|
||||||
get_http_version_string() const {
|
get_http_version_string() const {
|
||||||
switch (_http_version) {
|
switch (_http_version) {
|
||||||
|
case HV_09:
|
||||||
|
return "HTTP/0.9";
|
||||||
|
|
||||||
case HV_10:
|
case HV_10:
|
||||||
return "HTTP/1.0";
|
return "HTTP/1.0";
|
||||||
|
|
||||||
@ -191,6 +194,8 @@ parse_http_version_string(const string &version) {
|
|||||||
return HV_10;
|
return HV_10;
|
||||||
} else if (version == "HTTP/1.1") {
|
} else if (version == "HTTP/1.1") {
|
||||||
return HV_11;
|
return HV_11;
|
||||||
|
} else if (version.substr(0, 6) == "HTTP/0") {
|
||||||
|
return HV_09;
|
||||||
} else {
|
} else {
|
||||||
return HV_other;
|
return HV_other;
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,7 @@ PUBLISHED:
|
|||||||
string get_username(const string &server, const string &realm) const;
|
string get_username(const string &server, const string &realm) const;
|
||||||
|
|
||||||
enum HTTPVersion {
|
enum HTTPVersion {
|
||||||
|
HV_09, // HTTP 0.9 or older
|
||||||
HV_10, // HTTP 1.0
|
HV_10, // HTTP 1.0
|
||||||
HV_11, // HTTP 1.1
|
HV_11, // HTTP 1.1
|
||||||
HV_other,
|
HV_other,
|
||||||
|
@ -228,8 +228,8 @@ is_regular_file() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool HTTPDocument::
|
bool HTTPDocument::
|
||||||
will_close_connection() const {
|
will_close_connection() const {
|
||||||
if (get_http_version() == HTTPClient::HV_10) {
|
if (get_http_version() < HTTPClient::HV_11) {
|
||||||
// HTTP 1.0 always closes.
|
// pre-HTTP 1.1 always closes.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user