mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
http_proxy and http_proxy_username in configrc
This commit is contained in:
parent
27df52fbfe
commit
d19ee8dba4
@ -78,6 +78,13 @@ config_downloader.GetBool("early-random-seed", true);
|
||||
const bool verify_ssl =
|
||||
config_downloader.GetBool("verify-ssl", true);
|
||||
|
||||
// This specifies the proxy that we will contact for all HTTP
|
||||
// connections that don't specify otherwise.
|
||||
const string http_proxy =
|
||||
config_downloader.GetString("http-proxy", "");
|
||||
const string http_proxy_username =
|
||||
config_downloader.GetString("http-proxy-username", "");
|
||||
|
||||
ConfigureFn(config_downloader) {
|
||||
#ifdef HAVE_SSL
|
||||
HTTPChannel::init_type();
|
||||
|
@ -40,5 +40,7 @@ extern const int patcher_buffer_size;
|
||||
|
||||
extern const bool early_random_seed;
|
||||
extern const bool verify_ssl;
|
||||
extern const string http_proxy;
|
||||
extern const string http_proxy_username;
|
||||
|
||||
#endif
|
||||
|
@ -55,6 +55,11 @@ HTTPClient() {
|
||||
_verify_ssl = verify_ssl ? VS_normal : VS_no_verify;
|
||||
_ssl_ctx = (SSL_CTX *)NULL;
|
||||
|
||||
_proxy = URLSpec(http_proxy, 1);
|
||||
if (!http_proxy_username.empty()) {
|
||||
set_username("*proxy", "", http_proxy_username);
|
||||
}
|
||||
|
||||
// The first time we create an HTTPClient, we must initialize the
|
||||
// OpenSSL library.
|
||||
if (!_ssl_initialized) {
|
||||
@ -69,10 +74,6 @@ HTTPClient() {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
HTTPClient::
|
||||
HTTPClient(const HTTPClient ©) {
|
||||
// We can initialize these to default values because the operator =
|
||||
// function will copy them in a second.
|
||||
_http_version = HV_11;
|
||||
_verify_ssl = verify_ssl ? VS_normal : VS_no_verify;
|
||||
_ssl_ctx = (SSL_CTX *)NULL;
|
||||
|
||||
(*this) = copy;
|
||||
@ -88,6 +89,7 @@ operator = (const HTTPClient ©) {
|
||||
_proxy = copy._proxy;
|
||||
_http_version = copy._http_version;
|
||||
_verify_ssl = copy._verify_ssl;
|
||||
_usernames = copy._usernames;
|
||||
clear_expected_servers();
|
||||
|
||||
ExpectedServers::const_iterator ei;
|
||||
|
Loading…
x
Reference in New Issue
Block a user