diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-07 22:01:47 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-07 22:01:47 +0000 |
commit | 9f126095a6f70fdd850228f9ca9632ba0acbc357 (patch) | |
tree | 00c77a2ed1b7dea683b88a48b175a585663e4d61 /src/modules/netlib | |
parent | 83f57f5092fd96fef29fd2784ed5d7701b52378b (diff) |
merge of rev. 14316
git-svn-id: http://svn.miranda-ng.org/main/trunk@2240 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib')
-rw-r--r-- | src/modules/netlib/netlibopenconn.cpp | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp index 1f23c7e197..ae4526f70f 100644 --- a/src/modules/netlib/netlibopenconn.cpp +++ b/src/modules/netlib/netlibopenconn.cpp @@ -708,34 +708,22 @@ 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 {
- 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;
+ if (nlu->settings.useProxy && !usingProxy && nlu->settings.proxyType == PROXYTYPE_IE && !forceHttps) {
+ 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 && (nlc->proxyType == PROXYTYPE_HTTP || nlc->proxyType == PROXYTYPE_HTTPS))) {
|