diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-12-16 15:48:06 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-12-16 15:48:06 +0100 |
commit | dfed49a5353b127a2e55e9d9c1dd7375e8158af3 (patch) | |
tree | 4c5ac799e8cb9a0c8e2d3dca9f84f7beed481c56 /cpp/src/Ice/ConnectionFactory.cpp | |
parent | http://bugzilla/bugzilla/show_bug.cgi?id=4483 - replace \n with newlines in T... (diff) | |
download | ice-dfed49a5353b127a2e55e9d9c1dd7375e8158af3.tar.bz2 ice-dfed49a5353b127a2e55e9d9c1dd7375e8158af3.tar.xz ice-dfed49a5353b127a2e55e9d9c1dd7375e8158af3.zip |
Fixed bug 4481 - incoming connection factory assert
Diffstat (limited to 'cpp/src/Ice/ConnectionFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 601c0634850..ba67dac2538 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -1534,7 +1534,7 @@ IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const Instance } void -IceInternal::IncomingConnectionFactory::initialize(const string& adapterName) +IceInternal::IncomingConnectionFactory::initialize(const string& oaName) { if(_instance->defaultsAndOverrides()->overrideTimeout) { @@ -1548,16 +1548,26 @@ IceInternal::IncomingConnectionFactory::initialize(const string& adapterName) _endpoint->compress(_instance->defaultsAndOverrides()->overrideCompressValue); } - const_cast<TransceiverPtr&>(_transceiver) = _endpoint->transceiver(const_cast<EndpointIPtr&>(_endpoint)); - if(_transceiver) + try { - ConnectionIPtr connection; - - try + const_cast<TransceiverPtr&>(_transceiver) = _endpoint->transceiver(const_cast<EndpointIPtr&>(_endpoint)); + if(_transceiver) { - connection = new ConnectionI(_instance, _reaper, _transceiver, 0, _endpoint, _adapter); + ConnectionIPtr connection = new ConnectionI(_instance, _reaper, _transceiver, 0, _endpoint, _adapter); + connection->start(0); + _connections.insert(connection); } - catch(const LocalException&) + else + { + const_cast<AcceptorPtr&>(_acceptor) = _endpoint->acceptor(const_cast<EndpointIPtr&>(_endpoint), oaName); + assert(_acceptor); + _acceptor->listen(); + dynamic_cast<ObjectAdapterI*>(_adapter.get())->getThreadPool()->initialize(this); + } + } + catch(const Ice::Exception&) + { + if(_transceiver) { try { @@ -1567,35 +1577,30 @@ IceInternal::IncomingConnectionFactory::initialize(const string& adapterName) { // Ignore } - throw; } - connection->start(0); - - _connections.insert(connection); - } - else - { - _acceptor = _endpoint->acceptor(const_cast<EndpointIPtr&>(_endpoint), adapterName); - assert(_acceptor); - _acceptor->listen(); - try - { - dynamic_cast<ObjectAdapterI*>(_adapter.get())->getThreadPool()->initialize(this); - } - catch(const Ice::Exception&) + if(_acceptor) { - _acceptor->close(); - _acceptor = 0; - throw; + try + { + _acceptor->close(); + } + catch(const Ice::LocalException&) + { + // Ignore + } } + + _state = StateFinished; + _connections.clear(); + throw; } } IceInternal::IncomingConnectionFactory::~IncomingConnectionFactory() { - //assert(_state == StateFinished); + assert(_state == StateFinished); assert(_connections.empty()); } |