From 93bc6dca95e1e30f3e274325e1cff9a29229d759 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 3 Jan 2009 22:49:21 +0000 Subject: [PATCH] - A lot of improvement in proxy code --- src/bittorrent.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 84def4215..123a582d3 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1075,14 +1075,26 @@ void bittorrent::setSessionSettings(session_settings sessionSettings) { // Set Proxy void bittorrent::setProxySettings(proxy_settings proxySettings, bool trackers, bool peers, bool web_seeds, bool dht) { qDebug("Set Proxy settings"); + proxy_settings ps_null; + ps_null.type = proxy_settings::none; if(trackers) s->set_tracker_proxy(proxySettings); + else + s->set_tracker_proxy(ps_null); + if(peers) s->set_peer_proxy(proxySettings); + else + s->set_peer_proxy(ps_null); if(web_seeds) s->set_web_seed_proxy(proxySettings); - if(DHTEnabled && dht) { - s->set_dht_proxy(proxySettings); + else + s->set_web_seed_proxy(ps_null); + if(DHTEnabled) { + if(dht) + s->set_dht_proxy(proxySettings); + else + s->set_dht_proxy(ps_null); } }