summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorborkra <borkra@43f3a57c-415d-409d-a226-9ac53bca7782>2012-06-19 12:28:53 +0000
committerborkra <borkra@43f3a57c-415d-409d-a226-9ac53bca7782>2012-06-19 12:28:53 +0000
commit983d0a0575b639d87c09c09fac3fc848b3b9503e (patch)
tree54902af06ab482b1f9229d81578421c5444e8058
parent38539ecf3c39d0de45574952ca41b539e83c3ab3 (diff)
Fixed proxy negotiation logicstable
git-svn-id: svn://svn.code.sf.net/p/miranda/svn/branches/stable@14317 43f3a57c-415d-409d-a226-9ac53bca7782
-rw-r--r--miranda/src/modules/netlib/netlibopenconn.cpp41
1 files changed, 12 insertions, 29 deletions
diff --git a/miranda/src/modules/netlib/netlibopenconn.cpp b/miranda/src/modules/netlib/netlibopenconn.cpp
index f24906b20..ae039a94d 100644
--- a/miranda/src/modules/netlib/netlibopenconn.cpp
+++ b/miranda/src/modules/netlib/netlibopenconn.cpp
@@ -760,42 +760,25 @@ bool NetlibDoConnect(NetlibConnection *nlc)
}
}
-retry:
- if (usingProxy)
- {
- if (!my_connect(nlc, nloc))
- {
- usingProxy = false;
- nlc->proxyType = 0;
- }
- }
- if (!usingProxy)
- {
- my_connect(nlc, nloc);
- }
-
- if (nlc->s == INVALID_SOCKET)
+ while (!my_connect(nlc, nloc))
{
+ // Fallback to direct only when using HTTP proxy, as this is what used by companies
+ // If other type of proxy used it's an indication of security nutcase, leave him alone
if (usingProxy && (nlc->proxyType == PROXYTYPE_HTTPS || nlc->proxyType == PROXYTYPE_HTTP))
{
usingProxy = false;
- if (!NetlibHttpFallbackToDirect(nlc, nlu, nloc))
- {
- NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "connect", WSAGetLastError());
- return false;
- }
+ nlc->proxyType = 0;
+ NetlibLogf(nlu,"Fallback to direct connection");
+ continue;
}
- else
+ else if (nlu->settings.useProxy && !usingProxy && nlu->settings.proxyType == PROXYTYPE_IE && !forceHttps)
{
- if (nlu->settings.useProxy && !usingProxy && nlu->settings.proxyType == PROXYTYPE_IE && !forceHttps)
- {
- forceHttps = true;
- usingProxy = NetlibGetIeProxyConn(nlc, true);
- if (usingProxy) goto retry;
- }
- NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "connect", WSAGetLastError());
- return false;
+ forceHttps = true;
+ usingProxy = NetlibGetIeProxyConn(nlc, true);
+ if (usingProxy) continue;
}
+ NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "connect", WSAGetLastError());
+ return false;
}
if (usingProxy && !((nloc->flags & (NLOCF_HTTP | NLOCF_SSL)) == NLOCF_HTTP &&