summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-18 16:22:06 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-18 16:50:18 (GMT)
commit8472194d716e0e3b95a66bf5be45c246ee79d0af (patch)
treeb9f473e0e606b012ee5013e85d2cf5e7523b7029 /Swiften/Network/SOCKS5ProxiedConnection.cpp
parentb1b3b8f88517ad8b14795cc8a6265962d2935be3 (diff)
downloadswift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.zip
swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.tar.bz2
Propagate use of SafeByteArray down to the connection.
Diffstat (limited to 'Swiften/Network/SOCKS5ProxiedConnection.cpp')
-rw-r--r--Swiften/Network/SOCKS5ProxiedConnection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Network/SOCKS5ProxiedConnection.cpp b/Swiften/Network/SOCKS5ProxiedConnection.cpp
index cf531e5..f8084ab 100644
--- a/Swiften/Network/SOCKS5ProxiedConnection.cpp
+++ b/Swiften/Network/SOCKS5ProxiedConnection.cpp
@@ -60,7 +60,7 @@ void SOCKS5ProxiedConnection::handleDisconnected(const boost::optional<Error>& e
onDisconnected(error);
}
-void SOCKS5ProxiedConnection::write(const ByteArray& data) {
+void SOCKS5ProxiedConnection::write(const SafeByteArray& data) {
if (connection_) {
connection_->write(data);
}
@@ -72,7 +72,7 @@ void SOCKS5ProxiedConnection::handleConnectionConnectFinished(bool error) {
SWIFT_LOG(debug) << "Connection to proxy established, now connect to the server via it." << std::endl;
proxyState_ = ProxyAuthenticating;
- ByteArray socksConnect;
+ SafeByteArray socksConnect;
socksConnect.push_back(0x05); // VER = SOCKS5 = 0x05
socksConnect.push_back(0x01); // Number of authentication methods after this byte.
socksConnect.push_back(0x00); // 0x00 == no authentication
@@ -86,8 +86,8 @@ void SOCKS5ProxiedConnection::handleConnectionConnectFinished(bool error) {
}
}
-void SOCKS5ProxiedConnection::handleDataRead(const ByteArray& data) {
- ByteArray socksConnect;
+void SOCKS5ProxiedConnection::handleDataRead(const SafeByteArray& data) {
+ SafeByteArray socksConnect;
boost::asio::ip::address rawAddress = server_.getAddress().getRawAddress();
assert(rawAddress.is_v4() || rawAddress.is_v6());
if (!connected_) {