diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:22:06 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:50:18 (GMT) |
commit | 8472194d716e0e3b95a66bf5be45c246ee79d0af (patch) | |
tree | b9f473e0e606b012ee5013e85d2cf5e7523b7029 /Swiften/TLS/OpenSSL/OpenSSLContext.cpp | |
parent | b1b3b8f88517ad8b14795cc8a6265962d2935be3 (diff) | |
download | swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.zip swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.tar.bz2 |
Propagate use of SafeByteArray down to the connection.
Diffstat (limited to 'Swiften/TLS/OpenSSL/OpenSSLContext.cpp')
-rw-r--r-- | Swiften/TLS/OpenSSL/OpenSSLContext.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp index 97094bf..8d3970e 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp @@ -138,14 +138,14 @@ void OpenSSLContext::doConnect() { void OpenSSLContext::sendPendingDataToNetwork() { int size = BIO_pending(writeBIO_); if (size > 0) { - ByteArray data; + SafeByteArray data; data.resize(size); BIO_read(writeBIO_, vecptr(data), size); onDataForNetwork(data); } } -void OpenSSLContext::handleDataFromNetwork(const ByteArray& data) { +void OpenSSLContext::handleDataFromNetwork(const SafeByteArray& data) { BIO_write(readBIO_, vecptr(data), data.size()); switch (state_) { case Connecting: @@ -159,7 +159,7 @@ void OpenSSLContext::handleDataFromNetwork(const ByteArray& data) { } } -void OpenSSLContext::handleDataFromApplication(const ByteArray& data) { +void OpenSSLContext::handleDataFromApplication(const SafeByteArray& data) { if (SSL_write(handle_, vecptr(data), data.size()) >= 0) { sendPendingDataToNetwork(); } @@ -170,7 +170,7 @@ void OpenSSLContext::handleDataFromApplication(const ByteArray& data) { } void OpenSSLContext::sendPendingDataToApplication() { - ByteArray data; + SafeByteArray data; data.resize(SSL_READ_BUFFERSIZE); int ret = SSL_read(handle_, vecptr(data), data.size()); while (ret > 0) { |