summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2019-11-19 13:36:05 (GMT)
committerEdwin Mons <edwin.mons@isode.com>2019-11-19 13:58:45 (GMT)
commit261ba8d8595ed8cb90f9c4feb1d6ef642942bcba (patch)
treec7e60d473509db8c4dbff5aa83fbde963d8dd75e /Swiften/Network/SOCKS5ProxiedConnection.cpp
parent697ae6ae84512a744958b24118197ec7bfdbc1f0 (diff)
downloadswift-261ba8d8595ed8cb90f9c4feb1d6ef642942bcba.zip
swift-261ba8d8595ed8cb90f9c4feb1d6ef642942bcba.tar.bz2
Remove std::endl from SWIFT_LOG calls
The std::endl is now added by ~Log, but only for output to stderr or a log file. Calls to the Android logging system or manually set callbacks will not include the newline in the logging output. JIRA: SWIFT-430 Test-Information: Unit tests pass on Debian 9 Checked that running Swift with logging to stderr still had a newline. Change-Id: I096fdba78a3b8f87db2097951c28c528592183e8
Diffstat (limited to 'Swiften/Network/SOCKS5ProxiedConnection.cpp')
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnection.cpp14
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 }