diff options
author | Benoit Foucher <benoit@zeroc.com> | 2019-01-29 15:31:08 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2019-01-29 15:31:37 +0100 |
commit | 1709c90dc1963c4f23e80a5e615d8a50ad1dab3c (patch) | |
tree | 242b723f3e666fb6aa6105c70a493e94a5a29459 /cpp/src/IceSSL | |
parent | Fix typo (diff) | |
download | ice-1709c90dc1963c4f23e80a5e615d8a50ad1dab3c.tar.bz2 ice-1709c90dc1963c4f23e80a5e615d8a50ad1dab3c.tar.xz ice-1709c90dc1963c4f23e80a5e615d8a50ad1dab3c.zip |
Fixed Windows IceOpenSSL to not rely on FD if invalid
Diffstat (limited to 'cpp/src/IceSSL')
-rw-r--r-- | cpp/src/IceSSL/OpenSSLTransceiverI.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp index 5c5a7390586..6fcffc8b3e8 100644 --- a/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +++ b/cpp/src/IceSSL/OpenSSLTransceiverI.cpp @@ -95,16 +95,6 @@ OpenSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal:: { SOCKET fd = _delegate->getNativeInfo()->fd(); BIO* bio = 0; - #ifdef ICE_USE_IOCP - _maxSendPacketSize = std::max(512, IceInternal::getSendBufferSize(fd)); - _maxRecvPacketSize = std::max(512, IceInternal::getRecvBufferSize(fd)); - _sentBytes = 0; - if(!BIO_new_bio_pair(&bio, _maxSendPacketSize, &_memBio, _maxRecvPacketSize)) - { - bio = 0; - _memBio = 0; - } -#else if(fd == INVALID_SOCKET) { assert(_sentBytes == 0); @@ -118,12 +108,22 @@ OpenSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal:: } else { + #ifdef ICE_USE_IOCP + _maxSendPacketSize = std::max(512, IceInternal::getSendBufferSize(fd)); + _maxRecvPacketSize = std::max(512, IceInternal::getRecvBufferSize(fd)); + _sentBytes = 0; + if(!BIO_new_bio_pair(&bio, _maxSendPacketSize, &_memBio, _maxRecvPacketSize)) + { + bio = 0; + _memBio = 0; + } +#else // // This static_cast is necessary due to 64bit windows. There SOCKET is a non-int type. // bio = BIO_new_socket(static_cast<int>(fd), 0); - } #endif + } if(!bio) { |