summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-08-28 21:21:06 +0000
committerMarc Laukien <marc@zeroc.com>2002-08-28 21:21:06 +0000
commitdfa87a37643a0dc76ac590af86a59ba7e98509ac (patch)
treeec63121861f9ab287ed82bb8e5362a7bbadcd361 /cpp/src
parentcleanup; dynamic factory loading (diff)
downloadice-dfa87a37643a0dc76ac590af86a59ba7e98509ac.tar.bz2
ice-dfa87a37643a0dc76ac590af86a59ba7e98509ac.tar.xz
ice-dfa87a37643a0dc76ac590af86a59ba7e98509ac.zip
some cleanup
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Freeze/freeze.dsp4
-rw-r--r--cpp/src/Glacier/glacier.dsp4
-rw-r--r--cpp/src/Ice/Connection.cpp15
-rw-r--r--cpp/src/Ice/Connection.h24
-rw-r--r--cpp/src/Ice/ConnectionFactory.cpp15
-rw-r--r--cpp/src/Ice/ConnectionFactory.h14
-rw-r--r--cpp/src/Ice/EventHandler.h2
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp2
-rw-r--r--cpp/src/Ice/TcpTransceiver.cpp129
-rw-r--r--cpp/src/Ice/UdpTransceiver.cpp72
-rw-r--r--cpp/src/IceBox/icebox.dsp4
-rw-r--r--cpp/src/IcePack/icepack.dsp4
-rw-r--r--cpp/src/IcePatch/icepatch.dsp4
-rw-r--r--cpp/src/IceSSL/SslTransceiver.cpp12
-rw-r--r--cpp/src/IceSSL/icessl.dsp4
-rw-r--r--cpp/src/IceStorm/icestorm.dsp4
-rw-r--r--cpp/src/IceStorm/icestormS.dsp4
-rw-r--r--cpp/src/IceUtil/iceutil.dsp4
-rw-r--r--cpp/src/IceXML/icexml.dsp4
-rw-r--r--cpp/src/Slice/slice.dsp4
-rw-r--r--cpp/src/Yellow/yellow.dsp4
-rw-r--r--cpp/src/Yellow/yellowS.dsp4
22 files changed, 169 insertions, 168 deletions
diff --git a/cpp/src/Freeze/freeze.dsp b/cpp/src/Freeze/freeze.dsp
index 7883e505f23..24f5613d772 100644
--- a/cpp/src/Freeze/freeze.dsp
+++ b/cpp/src/Freeze/freeze.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\freeze001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\freeze001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "Freeze - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\freeze001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\freeze001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/Glacier/glacier.dsp b/cpp/src/Glacier/glacier.dsp
index 7206b128796..b63a7c1ddd3 100644
--- a/cpp/src/Glacier/glacier.dsp
+++ b/cpp/src/Glacier/glacier.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\glacier001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\glacier001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "Glacier - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\glacier001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\glacier001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp
index 5aecbe9b1a8..eaad513e59e 100644
--- a/cpp/src/Ice/Connection.cpp
+++ b/cpp/src/Ice/Connection.cpp
@@ -807,6 +807,7 @@ IceInternal::Connection::Connection(const InstancePtr& instance,
_logger(_instance->logger()),
_traceLevels(_instance->traceLevels()),
_defaultsAndOverrides(_instance->defaultsAndOverrides()),
+ _warn(_instance->properties()->getPropertyAsInt("Ice.ConnectionWarnings") > 0),
_nextRequestId(1),
_requestsHint(_requests.end()),
_batchStream(_instance),
@@ -815,8 +816,6 @@ IceInternal::Connection::Connection(const InstancePtr& instance,
_state(StateHolding),
_registeredWithPool(false)
{
- _warn = _instance->properties()->getPropertyAsInt("Ice.ConnectionWarnings") > 0;
-
if(_endpoint->datagram())
{
//
@@ -1034,7 +1033,7 @@ IceInternal::Connection::setState(State state)
}
void
-IceInternal::Connection::validateConnection()
+IceInternal::Connection::validateConnection() const
{
BasicStream os(_instance);
os.write(protocolVersion);
@@ -1047,7 +1046,7 @@ IceInternal::Connection::validateConnection()
}
void
-IceInternal::Connection::closeConnection()
+IceInternal::Connection::closeConnection() const
{
BasicStream os(_instance);
os.write(protocolVersion);
@@ -1071,18 +1070,18 @@ IceInternal::Connection::registerWithPool()
{
if(_adapter)
{
- if(!_serverThreadPool)
+ if(!_serverThreadPool) // Lazy initialization.
{
- _serverThreadPool = _instance->serverThreadPool();
+ const_cast<ThreadPoolPtr&>(_serverThreadPool) = _instance->serverThreadPool();
assert(_serverThreadPool);
}
_serverThreadPool->_register(_transceiver->fd(), this);
}
else
{
- if(!_clientThreadPool)
+ if(!_clientThreadPool) // Lazy initialization.
{
- _clientThreadPool = _instance->clientThreadPool();
+ const_cast<ThreadPoolPtr&>(_clientThreadPool) = _instance->clientThreadPool();
assert(_clientThreadPool);
}
_clientThreadPool->_register(_transceiver->fd(), this);
diff --git a/cpp/src/Ice/Connection.h b/cpp/src/Ice/Connection.h
index 20706929ca2..0aa118ac89c 100644
--- a/cpp/src/Ice/Connection.h
+++ b/cpp/src/Ice/Connection.h
@@ -90,21 +90,22 @@ private:
void setState(State, const ::Ice::LocalException&);
void setState(State);
- void validateConnection();
- void closeConnection();
+ void validateConnection() const;
+ void closeConnection() const;
void registerWithPool();
void unregisterWithPool();
- void compress(BasicStream&, BasicStream&);
- void uncompress(BasicStream&, BasicStream&);
+ static void compress(BasicStream&, BasicStream&);
+ static void uncompress(BasicStream&, BasicStream&);
- TransceiverPtr _transceiver;
- EndpointPtr _endpoint;
+ const TransceiverPtr _transceiver;
+ const EndpointPtr _endpoint;
::Ice::ObjectAdapterPtr _adapter;
- ::Ice::LoggerPtr _logger;
- TraceLevelsPtr _traceLevels;
- DefaultsAndOverridesPtr _defaultsAndOverrides;
- ThreadPoolPtr _clientThreadPool;
- ThreadPoolPtr _serverThreadPool;
+ const ::Ice::LoggerPtr _logger;
+ const TraceLevelsPtr _traceLevels;
+ const DefaultsAndOverridesPtr _defaultsAndOverrides;
+ const ThreadPoolPtr _clientThreadPool;
+ const ThreadPoolPtr _serverThreadPool;
+ const bool _warn;
::Ice::Int _nextRequestId;
std::map< ::Ice::Int, Outgoing*> _requests;
std::map< ::Ice::Int, Outgoing*>::iterator _requestsHint;
@@ -113,7 +114,6 @@ private:
int _responseCount;
int _proxyUsageCount;
State _state;
- bool _warn;
bool _registeredWithPool;
bool _connectionValidated;
};
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp
index 0cd4faa5dc4..cf022cce2fa 100644
--- a/cpp/src/Ice/ConnectionFactory.cpp
+++ b/cpp/src/Ice/ConnectionFactory.cpp
@@ -418,20 +418,19 @@ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const Instance
EventHandler(instance),
_endpoint(endpoint),
_adapter(adapter),
+ _warn(_instance->properties()->getPropertyAsInt("Ice.ConnectionWarnings") > 0),
_state(StateHolding),
_registeredWithPool(false)
{
DefaultsAndOverridesPtr defaultsAndOverrides = _instance->defaultsAndOverrides();
if(defaultsAndOverrides->overrideTimeout)
{
- _endpoint = _endpoint->timeout(defaultsAndOverrides->overrideTimeoutValue);
+ const_cast<EndpointPtr&>(_endpoint) = _endpoint->timeout(defaultsAndOverrides->overrideTimeoutValue);
}
- _warn = _instance->properties()->getPropertyAsInt("Ice.ConnectionWarnings") > 0;
-
try
{
- _transceiver = _endpoint->serverTransceiver(_endpoint);
+ const_cast<TransceiverPtr&>(_transceiver) = _endpoint->serverTransceiver(const_cast<EndpointPtr&>(_endpoint));
if(_transceiver)
{
ConnectionPtr connection = new Connection(_instance, _transceiver, _endpoint, _adapter);
@@ -447,7 +446,7 @@ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const Instance
}
else
{
- _acceptor = _endpoint->acceptor(_endpoint);
+ const_cast<AcceptorPtr&>(_acceptor) = _endpoint->acceptor(const_cast<EndpointPtr&>(_endpoint));
assert(_acceptor);
_acceptor->listen();
}
@@ -473,7 +472,7 @@ IceInternal::IncomingConnectionFactory::destroy()
}
void
-IceInternal::IncomingConnectionFactory::waitUntilFinished()
+IceInternal::IncomingConnectionFactory::waitUntilFinished() const
{
::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this);
@@ -551,9 +550,9 @@ IceInternal::IncomingConnectionFactory::registerWithPool()
{
if(!_registeredWithPool)
{
- if(!_serverThreadPool)
+ if(!_serverThreadPool) // Lazy initialization.
{
- _serverThreadPool = _instance->serverThreadPool();
+ const_cast<ThreadPoolPtr&>(_serverThreadPool) = _instance->serverThreadPool();
assert(_serverThreadPool);
}
_serverThreadPool->_register(_acceptor->fd(), this);
diff --git a/cpp/src/Ice/ConnectionFactory.h b/cpp/src/Ice/ConnectionFactory.h
index 504470002a6..76e56ab21da 100644
--- a/cpp/src/Ice/ConnectionFactory.h
+++ b/cpp/src/Ice/ConnectionFactory.h
@@ -78,7 +78,7 @@ private:
IncomingConnectionFactory(const InstancePtr&, const EndpointPtr&, const ::Ice::ObjectAdapterPtr&);
virtual ~IncomingConnectionFactory();
void destroy();
- void waitUntilFinished();
+ void waitUntilFinished() const;
friend class ::Ice::ObjectAdapterI;
enum State
@@ -92,14 +92,14 @@ private:
void registerWithPool();
void unregisterWithPool();
- EndpointPtr _endpoint;
- ::Ice::ObjectAdapterPtr _adapter;
- AcceptorPtr _acceptor;
- TransceiverPtr _transceiver;
- ThreadPoolPtr _serverThreadPool;
+ const EndpointPtr _endpoint;
+ ::Ice::ObjectAdapterPtr _adapter; // Cannot be const, because it must be set to zero to break cyclic dependency.
+ const AcceptorPtr _acceptor;
+ const TransceiverPtr _transceiver;
+ const ThreadPoolPtr _serverThreadPool;
+ const bool _warn;
std::list<ConnectionPtr> _connections;
State _state;
- bool _warn;
bool _registeredWithPool;
};
diff --git a/cpp/src/Ice/EventHandler.h b/cpp/src/Ice/EventHandler.h
index c25a233f5de..d7308f6ca30 100644
--- a/cpp/src/Ice/EventHandler.h
+++ b/cpp/src/Ice/EventHandler.h
@@ -64,7 +64,7 @@ protected:
EventHandler(const InstancePtr&);
virtual ~EventHandler();
- InstancePtr _instance;
+ const InstancePtr _instance;
private:
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index a7b64d3877f..932fdb037cb 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -157,7 +157,7 @@ Ice::ObjectAdapterI::waitForDeactivate()
// would be a deadlock with upcalls.)
//
for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
- Ice::voidMemFun(&IncomingConnectionFactory::waitUntilFinished));
+ Ice::constVoidMemFun(&IncomingConnectionFactory::waitUntilFinished));
}
ObjectPrx
diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp
index e08e90fda6a..c5583c99a60 100644
--- a/cpp/src/Ice/TcpTransceiver.cpp
+++ b/cpp/src/Ice/TcpTransceiver.cpp
@@ -23,6 +23,7 @@ using namespace IceInternal;
SOCKET
IceInternal::TcpTransceiver::fd()
{
+ assert(_fd != INVALID_SOCKET);
return _fd;
}
@@ -35,10 +36,9 @@ IceInternal::TcpTransceiver::close()
out << "closing tcp connection\n" << toString();
}
- SOCKET fd = _fd;
+ assert(_fd != INVALID_SOCKET);
+ closeSocket(_fd);
_fd = INVALID_SOCKET;
- ::shutdown(fd, SHUT_RDWR); // helps to unblock threads in recv()
- closeSocket(fd);
}
void
@@ -50,6 +50,7 @@ IceInternal::TcpTransceiver::shutdown()
out << "shutting down tcp connection\n" << toString();
}
+ assert(_fd != INVALID_SOCKET);
::shutdown(_fd, SHUT_WR); // Shutdown socket for writing
}
@@ -70,6 +71,7 @@ IceInternal::TcpTransceiver::write(Buffer& buf, int timeout)
while(buf.i != buf.b.end())
{
+ assert(_fd != INVALID_SOCKET);
int ret = ::send(_fd, &*buf.i, packetSize, 0);
if(ret == 0)
@@ -94,40 +96,39 @@ IceInternal::TcpTransceiver::write(Buffer& buf, int timeout)
if(wouldBlock())
{
- SOCKET fd = _fd; // Copy fd, in case another thread calls close()
- if(fd != INVALID_SOCKET)
+ repeatSelect:
+
+ int ret;
+ assert(_fd != INVALID_SOCKET);
+ FD_SET(_fd, &_wFdSet);
+
+ if(timeout >= 0)
{
- repeatSelect:
- int ret;
- FD_SET(fd, &_wFdSet);
- if(timeout >= 0)
- {
- struct timeval tv;
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout - tv.tv_sec * 1000) * 1000;
- ret = ::select(fd + 1, 0, &_wFdSet, 0, &tv);
- }
- else
- {
- ret = ::select(fd + 1, 0, &_wFdSet, 0, 0);
- }
-
- if(ret == SOCKET_ERROR)
+ struct timeval tv;
+ tv.tv_sec = timeout / 1000;
+ tv.tv_usec = (timeout - tv.tv_sec * 1000) * 1000;
+ ret = ::select(_fd + 1, 0, &_wFdSet, 0, &tv);
+ }
+ else
+ {
+ ret = ::select(_fd + 1, 0, &_wFdSet, 0, 0);
+ }
+
+ if(ret == SOCKET_ERROR)
+ {
+ if(interrupted())
{
- if(interrupted())
- {
- goto repeatSelect;
- }
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ goto repeatSelect;
}
- if(ret == 0)
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
+ }
+
+ if(ret == 0)
+ {
+ throw TimeoutException(__FILE__, __LINE__);
}
continue;
@@ -169,6 +170,7 @@ IceInternal::TcpTransceiver::read(Buffer& buf, int timeout)
while(buf.i != buf.b.end())
{
+ assert(_fd != INVALID_SOCKET);
int ret = ::recv(_fd, &*buf.i, packetSize, 0);
if(ret == 0)
@@ -193,42 +195,41 @@ IceInternal::TcpTransceiver::read(Buffer& buf, int timeout)
if(wouldBlock())
{
- SOCKET fd = _fd; // Copy fd, in case another thread calls close()
- if(fd != INVALID_SOCKET)
+ repeatSelect:
+
+ int ret;
+ assert(_fd != INVALID_SOCKET);
+ FD_SET(_fd, &_rFdSet);
+
+ if(timeout >= 0)
{
- repeatSelect:
- int ret;
- FD_SET(fd, &_rFdSet);
- if(timeout >= 0)
- {
- struct timeval tv;
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout - tv.tv_sec * 1000) * 1000;
- ret = ::select(fd + 1, &_rFdSet, 0, 0, &tv);
- }
- else
- {
- ret = ::select(fd + 1, &_rFdSet, 0, 0, 0);
- }
-
- if(ret == SOCKET_ERROR)
+ struct timeval tv;
+ tv.tv_sec = timeout / 1000;
+ tv.tv_usec = (timeout - tv.tv_sec * 1000) * 1000;
+ ret = ::select(_fd + 1, &_rFdSet, 0, 0, &tv);
+ }
+ else
+ {
+ ret = ::select(_fd + 1, &_rFdSet, 0, 0, 0);
+ }
+
+ if(ret == SOCKET_ERROR)
+ {
+ if(interrupted())
{
- if(interrupted())
- {
- goto repeatSelect;
- }
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ goto repeatSelect;
}
- if(ret == 0)
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
-
+
+ if(ret == 0)
+ {
+ throw TimeoutException(__FILE__, __LINE__);
+ }
+
continue;
}
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index efe1f4787d3..4347492e208 100644
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -23,6 +23,7 @@ using namespace IceInternal;
SOCKET
IceInternal::UdpTransceiver::fd()
{
+ assert(_fd != INVALID_SOCKET);
return _fd;
}
@@ -35,9 +36,9 @@ IceInternal::UdpTransceiver::close()
out << "closing " << _protocolName << " connection\n" << toString();
}
- SOCKET fd = _fd;
+ assert(_fd != INVALID_SOCKET);
+ closeSocket(_fd);
_fd = INVALID_SOCKET;
- closeSocket(fd);
}
void
@@ -55,6 +56,8 @@ IceInternal::UdpTransceiver::write(Buffer& buf, int)
#endif
repeat:
+
+ assert(_fd != INVALID_SOCKET);
int ret = ::send(_fd, &buf.b[0], buf.b.size(), 0);
if(ret == SOCKET_ERROR)
@@ -66,30 +69,27 @@ repeat:
if(wouldBlock())
{
- SOCKET fd = _fd; // Copy fd, in case another thread calls close()
- if(fd != INVALID_SOCKET)
- {
- repeatSelect:
+ repeatSelect:
- FD_SET(fd, &_wFdSet);
- int ret = ::select(fd + 1, 0, &_wFdSet, 0, 0);
-
- if(ret == SOCKET_ERROR)
+ assert(_fd != INVALID_SOCKET);
+ FD_SET(_fd, &_wFdSet);
+ int ret = ::select(_fd + 1, 0, &_wFdSet, 0, 0);
+
+ if(ret == SOCKET_ERROR)
+ {
+ if(interrupted())
{
- if(interrupted())
- {
- goto repeatSelect;
- }
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ goto repeatSelect;
}
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
goto repeat;
}
-
+
SocketException ex(__FILE__, __LINE__);
ex.error = getSocketErrno();
throw ex;
@@ -115,6 +115,7 @@ IceInternal::UdpTransceiver::read(Buffer& buf, int)
buf.i = buf.b.begin();
repeat:
+
int ret;
if(_connect)
{
@@ -125,11 +126,12 @@ repeat:
struct sockaddr_in peerAddr;
memset(&peerAddr, 0, sizeof(struct sockaddr_in));
socklen_t len = sizeof(peerAddr);
+ assert(_fd != INVALID_SOCKET);
ret = recvfrom(_fd, &buf.b[0], packetSize, 0, reinterpret_cast<struct sockaddr*>(&peerAddr), &len);
if(ret != SOCKET_ERROR)
{
doConnect(_fd, peerAddr, -1);
- _connect = false; // We're connected now
+ _connect = false; // We are connected now.
if(_traceLevels->network >= 1)
{
@@ -140,6 +142,7 @@ repeat:
}
else
{
+ assert(_fd != INVALID_SOCKET);
ret = ::recv(_fd, &buf.b[0], packetSize, 0);
}
@@ -152,25 +155,22 @@ repeat:
if(wouldBlock())
{
- SOCKET fd = _fd; // Copy fd, in case another thread calls close()
- if(fd != INVALID_SOCKET)
+ repeatSelect:
+
+ assert(_fd != INVALID_SOCKET);
+ FD_SET(_fd, &_rFdSet);
+ int ret = ::select(_fd + 1, &_rFdSet, 0, 0, 0);
+
+ if(ret == SOCKET_ERROR)
{
- repeatSelect:
-
- FD_SET(fd, &_rFdSet);
- int ret = ::select(fd + 1, &_rFdSet, 0, 0, 0);
-
- if(ret == SOCKET_ERROR)
+ if(interrupted())
{
- if(interrupted())
- {
- goto repeatSelect;
- }
-
- SocketException ex(__FILE__, __LINE__);
- ex.error = getSocketErrno();
- throw ex;
+ goto repeatSelect;
}
+
+ SocketException ex(__FILE__, __LINE__);
+ ex.error = getSocketErrno();
+ throw ex;
}
goto repeat;
diff --git a/cpp/src/IceBox/icebox.dsp b/cpp/src/IceBox/icebox.dsp
index b1a4a42c27e..c92c3e27f1c 100644
--- a/cpp/src/IceBox/icebox.dsp
+++ b/cpp/src/IceBox/icebox.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\icebox001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icebox001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IceBox - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\icebox001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icebox001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/IcePack/icepack.dsp b/cpp/src/IcePack/icepack.dsp
index d5b6cc09c83..99f2b547590 100644
--- a/cpp/src/IcePack/icepack.dsp
+++ b/cpp/src/IcePack/icepack.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\icepack001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icepack001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IcePack - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\icepack001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icepack001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/IcePatch/icepatch.dsp b/cpp/src/IcePatch/icepatch.dsp
index c78e4752e67..550c33d9aee 100644
--- a/cpp/src/IcePatch/icepatch.dsp
+++ b/cpp/src/IcePatch/icepatch.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\icepatch001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icepatch001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IcePatch - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\icepatch001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icepatch001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/IceSSL/SslTransceiver.cpp b/cpp/src/IceSSL/SslTransceiver.cpp
index 9295828b0f2..c8198dc247e 100644
--- a/cpp/src/IceSSL/SslTransceiver.cpp
+++ b/cpp/src/IceSSL/SslTransceiver.cpp
@@ -25,6 +25,7 @@ using IceSSL::ConnectionPtr;
SOCKET
IceSSL::SslTransceiver::fd()
{
+ assert(_fd != INVALID_SOCKET);
return _fd;
}
@@ -38,9 +39,6 @@ IceSSL::SslTransceiver::close()
_logger->trace(_traceLevels->networkCat, s.str());
}
- SOCKET fd = _fd;
- _fd = INVALID_SOCKET;
-
int shutdown = 0;
int numRetries = 100;
int retries = -numRetries;
@@ -51,8 +49,9 @@ IceSSL::SslTransceiver::close()
}
while((shutdown == 0) && (retries < 0));
- ::shutdown(fd, SHUT_RDWR); // helps to unblock threads in recv()
- closeSocket(fd);
+ assert(_fd != INVALID_SOCKET);
+ closeSocket(_fd);
+ _fd = INVALID_SOCKET;
}
void
@@ -75,18 +74,21 @@ IceSSL::SslTransceiver::shutdown()
}
while((shutdown == 0) && (retries < 0));
+ assert(_fd != INVALID_SOCKET);
::shutdown(_fd, SHUT_WR); // Shutdown socket for writing
}
void
IceSSL::SslTransceiver::write(Buffer& buf, int timeout)
{
+ assert(_fd != INVALID_SOCKET);
_sslConnection->write(buf, timeout);
}
void
IceSSL::SslTransceiver::read(Buffer& buf, int timeout)
{
+ assert(_fd != INVALID_SOCKET);
if(!_sslConnection->read(buf, timeout))
{
if(_traceLevels->security >= IceSSL::SECURITY_WARNINGS)
diff --git a/cpp/src/IceSSL/icessl.dsp b/cpp/src/IceSSL/icessl.dsp
index 9e0d69a4842..d9d08ffd030 100644
--- a/cpp/src/IceSSL/icessl.dsp
+++ b/cpp/src/IceSSL/icessl.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\icessl001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icessl001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IceSSL - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\icessl001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icessl001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/IceStorm/icestorm.dsp b/cpp/src/IceStorm/icestorm.dsp
index b181e8d6060..2322d2a6962 100644
--- a/cpp/src/IceStorm/icestorm.dsp
+++ b/cpp/src/IceStorm/icestorm.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\icestorm001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icestorm001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IceStorm - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\icestorm001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icestorm001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/IceStorm/icestormS.dsp b/cpp/src/IceStorm/icestormS.dsp
index 8efff71a5d6..317770030bc 100644
--- a/cpp/src/IceStorm/icestormS.dsp
+++ b/cpp/src/IceStorm/icestormS.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\icestormservice001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icestormservice001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IceStormS - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\icestormservice001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icestormservice001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/IceUtil/iceutil.dsp b/cpp/src/IceUtil/iceutil.dsp
index 598450146d1..ee8aa967ce7 100644
--- a/cpp/src/IceUtil/iceutil.dsp
+++ b/cpp/src/IceUtil/iceutil.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\iceutil001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\iceutil001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IceUtil - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\iceutil001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\iceutil001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/IceXML/icexml.dsp b/cpp/src/IceXML/icexml.dsp
index 4322a45e4e7..54823d8513b 100644
--- a/cpp/src/IceXML/icexml.dsp
+++ b/cpp/src/IceXML/icexml.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\icexml001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icexml001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "IceXML - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\icexml001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\icexml001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/Slice/slice.dsp b/cpp/src/Slice/slice.dsp
index 0f2c1688f08..92cb83f7d55 100644
--- a/cpp/src/Slice/slice.dsp
+++ b/cpp/src/Slice/slice.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\slice001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\slice001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "Slice - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\slice001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\slice001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/Yellow/yellow.dsp b/cpp/src/Yellow/yellow.dsp
index 96739c544cb..9571b2d54df 100644
--- a/cpp/src/Yellow/yellow.dsp
+++ b/cpp/src/Yellow/yellow.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\yellow001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\yellow001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "Yellow - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\yellow001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\yellow001d.* ..\..\lib
# End Special Build Tool
!ENDIF
diff --git a/cpp/src/Yellow/yellowS.dsp b/cpp/src/Yellow/yellowS.dsp
index a3aeba67b8a..d0dd261e917 100644
--- a/cpp/src/Yellow/yellowS.dsp
+++ b/cpp/src/Yellow/yellowS.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /debug /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Release\yellowservice001.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\yellowservice001.* ..\..\lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "YellowS - Win32 Debug"
@@ -90,7 +90,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none /nodefaultlib
# Begin Special Build Tool
SOURCE="$(InputPath)"
-PostBuild_Cmds=copy Debug\yellowservice001d.* ..\..\lib
+PostBuild_Cmds=copy $(OutDir)\yellowservice001d.* ..\..\lib
# End Special Build Tool
!ENDIF