summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/SChannelTransceiverI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceSSL/SChannelTransceiverI.cpp')
-rw-r--r--cpp/src/IceSSL/SChannelTransceiverI.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/cpp/src/IceSSL/SChannelTransceiverI.cpp b/cpp/src/IceSSL/SChannelTransceiverI.cpp
index 3946befe932..b5eca20d632 100644
--- a/cpp/src/IceSSL/SChannelTransceiverI.cpp
+++ b/cpp/src/IceSSL/SChannelTransceiverI.cpp
@@ -622,7 +622,7 @@ IceSSL::TransceiverI::encryptMessage(IceInternal::Buffer& buffer)
}
IceInternal::SocketOperation
-IceSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::Buffer& writeBuffer, bool& hasMoreData)
+IceSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::Buffer& writeBuffer)
{
IceInternal::SocketOperation op = _stream->connect(readBuffer, writeBuffer);
if(op != IceInternal::SocketOperationNone)
@@ -715,7 +715,7 @@ IceSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::B
}
}
- _engine->verifyPeer(_stream->fd(), _host, NativeConnectionInfoPtr::dynamicCast(getInfo()));
+ _engine->verifyPeer(_stream->fd(), _host, ICE_DYNAMIC_CAST(NativeConnectionInfo, getInfo()));
_state = StateHandshakeComplete;
if(_instance->engine()->securityTraceLevel() >= 1)
@@ -746,12 +746,17 @@ IceSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::B
}
out << toString();
}
- hasMoreData = !_readUnprocessed.b.empty() || _readBuffer.i != _readBuffer.b.begin();
+ _stream->ready(IceInternal::SocketOperationRead,
+ !_readUnprocessed.b.empty() || _readBuffer.i != _readBuffer.b.begin());
return IceInternal::SocketOperationNone;
}
IceInternal::SocketOperation
+#ifdef ICE_CPP11_MAPPING
+IceSSL::TransceiverI::closing(bool initiator, exception_ptr)
+#else
IceSSL::TransceiverI::closing(bool initiator, const Ice::LocalException&)
+#endif
{
// If we are initiating the connection closure, wait for the peer
// to close the TCP/IP connection. Otherwise, close immediately.
@@ -819,7 +824,7 @@ IceSSL::TransceiverI::write(IceInternal::Buffer& buf)
}
IceInternal::SocketOperation
-IceSSL::TransceiverI::read(IceInternal::Buffer& buf, bool& hasMoreData)
+IceSSL::TransceiverI::read(IceInternal::Buffer& buf)
{
if(!_stream->isConnected())
{
@@ -832,7 +837,7 @@ IceSSL::TransceiverI::read(IceInternal::Buffer& buf, bool& hasMoreData)
}
assert(_state == StateHandshakeComplete);
- hasMoreData = false;
+ _stream->ready(IceInternal::SocketOperationRead, false);
while(buf.i != buf.b.end())
{
if(_readUnprocessed.b.empty() && _readBuffer.i == _readBuffer.b.begin() && !readRaw(_readBuffer))
@@ -852,7 +857,8 @@ IceSSL::TransceiverI::read(IceInternal::Buffer& buf, bool& hasMoreData)
buf.i += decrypted;
}
- hasMoreData = !_readUnprocessed.b.empty() || _readBuffer.i != _readBuffer.b.begin();
+ _stream->ready(IceInternal::SocketOperationRead,
+ !_readUnprocessed.b.empty() || _readBuffer.i != _readBuffer.b.begin());
return IceInternal::SocketOperationNone;
}
@@ -909,7 +915,7 @@ IceSSL::TransceiverI::startRead(IceInternal::Buffer& buffer)
}
void
-IceSSL::TransceiverI::finishRead(IceInternal::Buffer& buf, bool& hasMoreData)
+IceSSL::TransceiverI::finishRead(IceInternal::Buffer& buf)
{
if(!_stream->isConnected())
{
@@ -924,11 +930,12 @@ IceSSL::TransceiverI::finishRead(IceInternal::Buffer& buf, bool& hasMoreData)
if(decrypted > 0)
{
buf.i += decrypted;
- hasMoreData = !_readUnprocessed.b.empty() || _readBuffer.i != _readBuffer.b.begin();
+ _stream->ready(IceInternal::SocketOperationRead,
+ !_readUnprocessed.b.empty() || _readBuffer.i != _readBuffer.b.begin());
}
else
{
- hasMoreData = false;
+ _stream->ready(IceInternal::SocketOperationRead, false);
}
}
}
@@ -955,7 +962,7 @@ IceSSL::TransceiverI::toDetailedString() const
Ice::ConnectionInfoPtr
IceSSL::TransceiverI::getInfo() const
{
- NativeConnectionInfoPtr info = new NativeConnectionInfo();
+ NativeConnectionInfoPtr info = ICE_MAKE_SHARED(NativeConnectionInfo);
fillConnectionInfo(info, info->nativeCerts);
return info;
}
@@ -963,7 +970,7 @@ IceSSL::TransceiverI::getInfo() const
Ice::ConnectionInfoPtr
IceSSL::TransceiverI::getWSInfo(const Ice::HeaderDict& headers) const
{
- WSSNativeConnectionInfoPtr info = new WSSNativeConnectionInfo();
+ WSSNativeConnectionInfoPtr info = ICE_MAKE_SHARED(WSSNativeConnectionInfo);
fillConnectionInfo(info, info->nativeCerts);
info->headers = headers;
return info;
@@ -1048,7 +1055,7 @@ IceSSL::TransceiverI::fillConnectionInfo(const ConnectionInfoPtr& info, vector<C
IceUtilInternal::lastErrorToString());
}
- CertificatePtr certificate = new Certificate(cc);
+ CertificatePtr certificate = ICE_MAKE_SHARED(Certificate, cc);
nativeCerts.push_back(certificate);
info->certs.push_back(certificate->encode());
}