diff options
author | Alex Borisov <b0ric.alex@gmail.com> | 2012-02-06 00:22:51 +0200 |
---|---|---|
committer | Alex Borisov <b0ric.alex@gmail.com> | 2012-02-06 00:22:51 +0200 |
commit | f62b8299abb67e69482f0c52359542834967fd73 (patch) | |
tree | 0f0e27bbb6d0e04a6169f0d35392b234856d8709 /client/Proxifier.cpp | |
parent | b18bd36aed6671eed7c1b985181506c4860b9331 (diff) |
FIX: http proxy to be the one and the last in the chain
Diffstat (limited to 'client/Proxifier.cpp')
-rw-r--r-- | client/Proxifier.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/client/Proxifier.cpp b/client/Proxifier.cpp index 4485647..0d3005d 100644 --- a/client/Proxifier.cpp +++ b/client/Proxifier.cpp @@ -320,13 +320,15 @@ bool Proxifier::TurnProxyOn(Proxy& proxy) { // proxy is not enabled - remove it and add again RemoveProxyFromChain(proxyId, chainId); - AddProxyToChain(proxyId, chainId); + bool isHttp = (stricmp(proxy.type.c_str(), "http") == 0); + AddProxyToChain(proxyId, chainId, isHttp); } } else { // proxy not found in the target chain - add it - AddProxyToChain(proxyId, chainId); + bool isHttp = (stricmp(proxy.type.c_str(), "http") == 0); + AddProxyToChain(proxyId, chainId, isHttp); } } @@ -1013,7 +1015,16 @@ bool Proxifier::AddProxyToChain(int proxyId, int chainId, bool isHttp) idTxt.setNum(proxyId); QDomText nameTxt = configDom.createTextNode(idTxt); proxyElem.appendChild(nameTxt); - chainElem.appendChild(proxyElem); + // append Http proxies to then end, but prepend other ones + if (isHttp) + { + chainElem.appendChild(proxyElem); + } + else + { + // first child is 'Name' + chainElem.insertAfter(proxyElem, chainElem.firstChildElement()); + } break; } } |