diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2014-08-07 12:18:42 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2014-08-07 12:18:42 -0230 |
commit | 232fa424a7339659b6ad2cd02fbfe89420457601 (patch) | |
tree | 978d9e9286c2915b771f8bea019276ab216eecc4 /cpp/src/IceSSL/OpenSSLTransceiverI.cpp | |
parent | Windows SSL SChannel implementation & OS X Secure Transport fixes. (diff) | |
download | ice-232fa424a7339659b6ad2cd02fbfe89420457601.tar.bz2 ice-232fa424a7339659b6ad2cd02fbfe89420457601.tar.xz ice-232fa424a7339659b6ad2cd02fbfe89420457601.zip |
ICE-5457 added ability to set source address for connections
Diffstat (limited to 'cpp/src/IceSSL/OpenSSLTransceiverI.cpp')
-rw-r--r-- | cpp/src/IceSSL/OpenSSLTransceiverI.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp index 14aad8b9163..39ae9e822e4 100644 --- a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +++ b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp @@ -291,7 +291,7 @@ IceSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::B if(_engine->securityTraceLevel() >= 1) { ostringstream ostr; - ostr << "IceSSL: ignoring certificate verification failure:\n" + ostr << "IceSSL: ignoring certificate verification failure:\n" << X509_verify_cert_error_string(result); _instance->logger()->trace(_instance->traceCategory(), ostr.str()); } @@ -440,6 +440,7 @@ IceSSL::TransceiverI::write(IceInternal::Buffer& buf) { ERR_clear_error(); // Clear any spurious errors. assert(_fd != INVALID_SOCKET); + int ret = SSL_write(_ssl, reinterpret_cast<const void*>(&*buf.i), packetSize); if(ret <= 0) { @@ -536,7 +537,7 @@ IceSSL::TransceiverI::read(IceInternal::Buffer& buf, bool&) // We assume that OpenSSL doesn't read more SSL records than // necessary to fill the requested data and that the sender sends // Ice messages in individual SSL records. - // + // if(_state == StateProxyConnectRequestPending) { @@ -721,13 +722,15 @@ IceSSL::TransceiverI::checkSendSize(const IceInternal::Buffer& buf, size_t messa } IceSSL::TransceiverI::TransceiverI(const InstancePtr& instance, SOCKET fd, const IceInternal::NetworkProxyPtr& proxy, - const string& host, const IceInternal::Address& addr) : + const string& host, const IceInternal::Address& addr, + const IceInternal::Address& sourceAddr) : IceInternal::NativeInfo(fd), _instance(instance), _engine(OpenSSLEnginePtr::dynamicCast(instance->engine())), _proxy(proxy), _host(host), _addr(addr), + _sourceAddr(sourceAddr), _incoming(false), _ssl(0), _state(StateNeedConnect) @@ -736,7 +739,7 @@ IceSSL::TransceiverI::TransceiverI(const InstancePtr& instance, SOCKET fd, const IceInternal::setTcpBufSize(fd, _instance->properties(), _instance->logger()); IceInternal::Address connectAddr = proxy ? proxy->getAddress() : addr; - if(IceInternal::doConnect(_fd, connectAddr)) + if(IceInternal::doConnect(_fd, connectAddr, _sourceAddr)) { _state = StateConnected; _desc = IceInternal::fdToString(_fd, _proxy, _addr, true); @@ -757,6 +760,7 @@ IceSSL::TransceiverI::TransceiverI(const InstancePtr& instance, SOCKET fd, const _instance(instance), _engine(OpenSSLEnginePtr::dynamicCast(instance->engine())), _addr(IceInternal::Address()), + _sourceAddr(IceInternal::getInvalidAddress()), _adapterName(adapterName), _incoming(true), _ssl(0), |