diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-05-09 23:44:04 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-05-09 23:44:04 +0000 |
commit | 08178d41304a3f8b0dda4b82b10e25fb2288c86b (patch) | |
tree | d408837cc6b5daae9eb2c5eabb72a82a411229c5 /cpp/src | |
parent | Changed library names on Windows for Ice 1.1 (diff) | |
download | ice-08178d41304a3f8b0dda4b82b10e25fb2288c86b.tar.bz2 ice-08178d41304a3f8b0dda4b82b10e25fb2288c86b.tar.xz ice-08178d41304a3f8b0dda4b82b10e25fb2288c86b.zip |
cache fdToString results to avoid exception when connection is shutdown on
Solaris
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/TcpTransceiver.cpp | 7 | ||||
-rw-r--r-- | cpp/src/Ice/TcpTransceiver.h | 1 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslTransceiver.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslTransceiver.h | 1 |
4 files changed, 16 insertions, 5 deletions
diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp index f4fbd688dde..1cf903bcfc2 100644 --- a/cpp/src/Ice/TcpTransceiver.cpp +++ b/cpp/src/Ice/TcpTransceiver.cpp @@ -280,7 +280,7 @@ IceInternal::TcpTransceiver::read(Buffer& buf, int timeout) string IceInternal::TcpTransceiver::toString() const { - return fdToString(_fd); + return _desc; } IceInternal::TcpTransceiver::TcpTransceiver(const InstancePtr& instance, SOCKET fd) : @@ -292,6 +292,11 @@ IceInternal::TcpTransceiver::TcpTransceiver(const InstancePtr& instance, SOCKET { FD_ZERO(&_rFdSet); FD_ZERO(&_wFdSet); + + // + // fdToString may raise a socket exception. + // + const_cast<string&>(_desc) = fdToString(_fd); } IceInternal::TcpTransceiver::~TcpTransceiver() diff --git a/cpp/src/Ice/TcpTransceiver.h b/cpp/src/Ice/TcpTransceiver.h index 64c2bde935e..3b4e22e934d 100644 --- a/cpp/src/Ice/TcpTransceiver.h +++ b/cpp/src/Ice/TcpTransceiver.h @@ -49,6 +49,7 @@ private: const Ice::LoggerPtr _logger; const Ice::StatsPtr _stats; const std::string _name; + const std::string _desc; SOCKET _fd; fd_set _rFdSet; diff --git a/cpp/src/IceSSL/SslTransceiver.cpp b/cpp/src/IceSSL/SslTransceiver.cpp index f5b3b5c34c2..6a83659c3cd 100644 --- a/cpp/src/IceSSL/SslTransceiver.cpp +++ b/cpp/src/IceSSL/SslTransceiver.cpp @@ -164,7 +164,7 @@ IceSSL::SslTransceiver::read(Buffer& buf, int timeout) { Trace out(_logger, _traceLevels->networkCat); out << "received " << bytesRead << " of " << packetSize; - out << " bytes via ssl\n" << fdToString(SSL_get_fd(_sslConnection)); + out << " bytes via ssl\n" << toString(); } if(_stats) @@ -272,7 +272,7 @@ IceSSL::SslTransceiver::read(Buffer& buf, int timeout) string IceSSL::SslTransceiver::toString() const { - return fdToString(_fd); + return _desc; } void @@ -303,8 +303,7 @@ IceSSL::SslTransceiver::forceHandshake() if(_traceLevels->security >= IceSSL::SECURITY_WARNINGS) { Trace out(_logger, _traceLevels->securityCat); - out << "Handshake retry maximum reached.\n"; - out << fdToString(SSL_get_fd(_sslConnection)); + out << "Handshake retry maximum reached.\n" << toString(); } // If the handshake fails, the connection failed. @@ -1017,6 +1016,11 @@ IceSSL::SslTransceiver::SslTransceiver(const OpenSSLPluginIPtr& plugin, // Set up the SSL to be able to refer back to our connection object. addTransceiver(_sslConnection, this); + + // + // fdToString may raise a socket exception. + // + const_cast<string&>(_desc) = fdToString(_fd); } IceSSL::SslTransceiver::~SslTransceiver() diff --git a/cpp/src/IceSSL/SslTransceiver.h b/cpp/src/IceSSL/SslTransceiver.h index 3e57783931a..781fa34a9f2 100644 --- a/cpp/src/IceSSL/SslTransceiver.h +++ b/cpp/src/IceSSL/SslTransceiver.h @@ -211,6 +211,7 @@ protected: const Ice::LoggerPtr _logger; const Ice::StatsPtr _stats; const std::string _name; + const std::string _desc; SOCKET _fd; fd_set _rFdSet; |