mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
add set_allow_proxy
This commit is contained in:
parent
5a7a566ec7
commit
b6ad0bf0aa
@ -211,6 +211,36 @@ get_persistent_connection() const {
|
||||
return _persistent_connection;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: HTTPChannel::set_allow_proxy
|
||||
// Access: Published
|
||||
// Description: If this is true (the normal case), the HTTPClient
|
||||
// will be consulted for information about the proxy to
|
||||
// be used for each connection via this HTTPChannel. If
|
||||
// this has been set to false by the user, then all
|
||||
// connections will be made directly, regardless of the
|
||||
// proxy settings indicated on the HTTPClient.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void HTTPChannel::
|
||||
set_allow_proxy(bool allow_proxy) {
|
||||
_allow_proxy = allow_proxy;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: HTTPChannel::get_allow_proxy
|
||||
// Access: Published
|
||||
// Description: If this is true (the normal case), the HTTPClient
|
||||
// will be consulted for information about the proxy to
|
||||
// be used for each connection via this HTTPChannel. If
|
||||
// this has been set to false by the user, then all
|
||||
// connections will be made directly, regardless of the
|
||||
// proxy settings indicated on the HTTPClient.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool HTTPChannel::
|
||||
get_allow_proxy() const {
|
||||
return _allow_proxy;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: HTTPChannel::set_connect_timeout
|
||||
// Access: Published
|
||||
|
@ -43,6 +43,7 @@ HTTPChannel(HTTPClient *client) :
|
||||
{
|
||||
_proxy_next_index = 0;
|
||||
_persistent_connection = false;
|
||||
_allow_proxy = true;
|
||||
_connect_timeout = connect_timeout;
|
||||
_http_timeout = http_timeout;
|
||||
_blocking_connect = false;
|
||||
@ -1794,7 +1795,9 @@ begin_request(HTTPEnum::Method method, const DocumentSpec &url,
|
||||
// Get the set of proxies that are appropriate for this URL.
|
||||
_proxies.clear();
|
||||
_proxy_next_index = 0;
|
||||
_client->get_proxies_for_url(url.get_url(), _proxies);
|
||||
if (get_allow_proxy()) {
|
||||
_client->get_proxies_for_url(url.get_url(), _proxies);
|
||||
}
|
||||
|
||||
// If we still have a live connection to a proxy that is on the
|
||||
// list, that proxy should be moved immediately to the front of the
|
||||
|
@ -91,6 +91,9 @@ PUBLISHED:
|
||||
INLINE void set_persistent_connection(bool persistent_connection);
|
||||
INLINE bool get_persistent_connection() const;
|
||||
|
||||
INLINE void set_allow_proxy(bool allow_proxy);
|
||||
INLINE bool get_allow_proxy() const;
|
||||
|
||||
INLINE void set_connect_timeout(double timeout_seconds);
|
||||
INLINE double get_connect_timeout() const;
|
||||
INLINE void set_blocking_connect(bool blocking_connect);
|
||||
@ -221,6 +224,7 @@ private:
|
||||
PT(BioPtr) _bio;
|
||||
PT(BioStreamPtr) _source;
|
||||
bool _persistent_connection;
|
||||
bool _allow_proxy;
|
||||
double _connect_timeout;
|
||||
double _http_timeout;
|
||||
bool _blocking_connect;
|
||||
|
Loading…
x
Reference in New Issue
Block a user