summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/SslTransceiver.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-06 10:24:49 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-06 10:24:49 +0000
commit49472ef931eb7a140a006035e394f0c4af42c110 (patch)
treee341603a9d74b6897cb4b69ed606fb26ccaf647c /cpp/src/IceSSL/SslTransceiver.cpp
parentfixes (diff)
downloadice-49472ef931eb7a140a006035e394f0c4af42c110.tar.bz2
ice-49472ef931eb7a140a006035e394f0c4af42c110.tar.xz
ice-49472ef931eb7a140a006035e394f0c4af42c110.zip
fixes
Diffstat (limited to 'cpp/src/IceSSL/SslTransceiver.cpp')
-rw-r--r--cpp/src/IceSSL/SslTransceiver.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/cpp/src/IceSSL/SslTransceiver.cpp b/cpp/src/IceSSL/SslTransceiver.cpp
index c8198dc247e..18378be7cae 100644
--- a/cpp/src/IceSSL/SslTransceiver.cpp
+++ b/cpp/src/IceSSL/SslTransceiver.cpp
@@ -8,7 +8,7 @@
//
// **********************************************************************
-#include <Ice/Logger.h>
+#include <Ice/LoggerUtil.h>
#include <Ice/Buffer.h>
#include <Ice/Network.h>
#include <IceSSL/OpenSSL.h>
@@ -34,24 +34,34 @@ IceSSL::SslTransceiver::close()
{
if(_traceLevels->network >= 1)
{
- ostringstream s;
- s << "closing ssl connection\n" << toString();
- _logger->trace(_traceLevels->networkCat, s.str());
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "closing ssl connection\n" << toString();
}
- int shutdown = 0;
- int numRetries = 100;
- int retries = -numRetries;
- do
+ try
{
- shutdown = _sslConnection->shutdown();
- retries++;
+ int shutdown = 0;
+ int numRetries = 100;
+ int retries = -numRetries;
+ do
+ {
+ shutdown = _sslConnection->shutdown();
+ retries++;
+ }
+ while((shutdown == 0) && (retries < 0));
+ }
+ catch(...)
+ {
+ assert(_fd != INVALID_SOCKET);
+ closeSocket(_fd);
+ _fd = INVALID_SOCKET;
+ throw;
}
- while((shutdown == 0) && (retries < 0));
assert(_fd != INVALID_SOCKET);
closeSocket(_fd);
_fd = INVALID_SOCKET;
+ throw;
}
void
@@ -59,9 +69,8 @@ IceSSL::SslTransceiver::shutdown()
{
if(_traceLevels->network >= 2)
{
- ostringstream s;
- s << "shutting down ssl connection\n" << toString();
- _logger->trace(_traceLevels->networkCat, s.str());
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "shutting down ssl connection\n" << toString();
}
int shutdown = 0;
@@ -93,7 +102,8 @@ IceSSL::SslTransceiver::read(Buffer& buf, int timeout)
{
if(_traceLevels->security >= IceSSL::SECURITY_WARNINGS)
{
- _logger->trace(_traceLevels->securityCat, "WRN reading from ssl connection returns no bytes");
+ Trace out(_logger, _traceLevels->securityCat);
+ out << "WRN reading from ssl connection returns no bytes";
}
}
}