diff options
Diffstat (limited to 'Swiften/Network/SOCKS5ProxiedConnection.cpp')
| -rw-r--r-- | Swiften/Network/SOCKS5ProxiedConnection.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Network/SOCKS5ProxiedConnection.cpp b/Swiften/Network/SOCKS5ProxiedConnection.cpp index d7036f2..c76b6e6 100644 --- a/Swiften/Network/SOCKS5ProxiedConnection.cpp +++ b/Swiften/Network/SOCKS5ProxiedConnection.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | /* | 7 | /* |
| 8 | * Copyright (c) 2014-2018 Isode Limited. | 8 | * Copyright (c) 2014-2019 Isode Limited. |
| 9 | * All rights reserved. | 9 | * All rights reserved. |
| 10 | * See the COPYING file for more information. | 10 | * See the COPYING file for more information. |
| 11 | */ | 11 | */ |
| @@ -50,7 +50,7 @@ void SOCKS5ProxiedConnection::handleProxyInitializeData(std::shared_ptr<SafeByte | |||
| 50 | assert(rawAddress.is_v4() || rawAddress.is_v6()); | 50 | assert(rawAddress.is_v4() || rawAddress.is_v6()); |
| 51 | 51 | ||
| 52 | if (proxyState_ == ProxyAuthenticating) { | 52 | if (proxyState_ == ProxyAuthenticating) { |
| 53 | SWIFT_LOG(debug) << "ProxyAuthenticating response received, reply with the connect BYTEs" << std::endl; | 53 | SWIFT_LOG(debug) << "ProxyAuthenticating response received, reply with the connect BYTEs"; |
| 54 | unsigned char choosenMethod = static_cast<unsigned char> ((*data)[1]); | 54 | unsigned char choosenMethod = static_cast<unsigned char> ((*data)[1]); |
| 55 | if ((*data)[0] == 0x05 && choosenMethod != 0xFF) { | 55 | if ((*data)[0] == 0x05 && choosenMethod != 0xFF) { |
| 56 | switch(choosenMethod) { // use the correct Method | 56 | switch(choosenMethod) { // use the correct Method |
| @@ -79,7 +79,7 @@ void SOCKS5ProxiedConnection::handleProxyInitializeData(std::shared_ptr<SafeByte | |||
| 79 | return; | 79 | return; |
| 80 | } | 80 | } |
| 81 | catch(...) { | 81 | catch(...) { |
| 82 | SWIFT_LOG(error) << "exception caught" << std::endl; | 82 | SWIFT_LOG(error) << "exception caught"; |
| 83 | } | 83 | } |
| 84 | write(socksConnect); | 84 | write(socksConnect); |
| 85 | break; | 85 | break; |
| @@ -92,8 +92,8 @@ void SOCKS5ProxiedConnection::handleProxyInitializeData(std::shared_ptr<SafeByte | |||
| 92 | setProxyInitializeFinished(false); | 92 | setProxyInitializeFinished(false); |
| 93 | } | 93 | } |
| 94 | else if (proxyState_ == ProxyConnecting) { | 94 | else if (proxyState_ == ProxyConnecting) { |
| 95 | SWIFT_LOG(debug) << "Connect response received, check if successfully." << std::endl; | 95 | SWIFT_LOG(debug) << "Connect response received, check if successfully."; |
| 96 | SWIFT_LOG(debug) << "Errorbyte: 0x" << std::hex << static_cast<int> ((*data)[1]) << std::dec << std::endl; | 96 | SWIFT_LOG(debug) << "Errorbyte: 0x" << std::hex << static_cast<int> ((*data)[1]) << std::dec; |
| 97 | /* | 97 | /* |
| 98 | 98 | ||
| 99 | data.at(1) can be one of the following: | 99 | data.at(1) can be one of the following: |
| @@ -109,11 +109,11 @@ void SOCKS5ProxiedConnection::handleProxyInitializeData(std::shared_ptr<SafeByte | |||
| 109 | 0x09 bis 0xFF unassigned | 109 | 0x09 bis 0xFF unassigned |
| 110 | */ | 110 | */ |
| 111 | if ((*data)[0] == 0x05 && (*data)[1] == 0x0) { | 111 | if ((*data)[0] == 0x05 && (*data)[1] == 0x0) { |
| 112 | SWIFT_LOG(debug) << "Successfully connected the server via the proxy." << std::endl; | 112 | SWIFT_LOG(debug) << "Successfully connected the server via the proxy."; |
| 113 | setProxyInitializeFinished(true); | 113 | setProxyInitializeFinished(true); |
| 114 | } | 114 | } |
| 115 | else { | 115 | else { |
| 116 | SWIFT_LOG(error) << "SOCKS Proxy returned an error: " << std::hex << (*data)[1] << std::endl; | 116 | SWIFT_LOG(error) << "SOCKS Proxy returned an error: " << std::hex << (*data)[1]; |
| 117 | setProxyInitializeFinished(false); | 117 | setProxyInitializeFinished(false); |
| 118 | } | 118 | } |
| 119 | } | 119 | } |
Swift