summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/OutgoingAsync.cpp68
1 files changed, 36 insertions, 32 deletions
diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp
index 905a80571b6..ebb55dedb75 100644
--- a/cpp/src/Ice/OutgoingAsync.cpp
+++ b/cpp/src/Ice/OutgoingAsync.cpp
@@ -156,48 +156,52 @@ IceInternal::OutgoingAsync::__finished(const LocalException& exc)
{
IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(_monitor);
- if(_reference->locatorInfo)
- {
- _reference->locatorInfo->clearObjectCache(_reference);
- }
-
- bool doRetry = false;
-
- //
- // A CloseConnectionException indicates graceful server shutdown,
- // and is therefore always repeatable without violating
- // "at-most-once". That's because by sending a close connection
- // message, the server guarantees that all outstanding requests
- // can safely be repeated. Otherwise, we can also retry if the
- // operation mode Nonmutating or Idempotent.
- //
- if(_mode == Nonmutating || _mode == Idempotent || dynamic_cast<const CloseConnectionException*>(&exc))
+ if(_reference)
{
- try
+ if(_reference->locatorInfo)
+ {
+ _reference->locatorInfo->clearObjectCache(_reference);
+ }
+
+ bool doRetry = false;
+
+ //
+ // A CloseConnectionException indicates graceful server
+ // shutdown, and is therefore always repeatable without
+ // violating "at-most-once". That's because by sending a close
+ // connection message, the server guarantees that all
+ // outstanding requests can safely be repeated. Otherwise, we
+ // can also retry if the operation mode Nonmutating or
+ // Idempotent.
+ //
+ if(_mode == Nonmutating || _mode == Idempotent || dynamic_cast<const CloseConnectionException*>(&exc))
{
- ProxyFactoryPtr proxyFactory = _reference->instance->proxyFactory();
- if(proxyFactory)
+ try
{
- proxyFactory->checkRetryAfterException(exc, _cnt);
+ ProxyFactoryPtr proxyFactory = _reference->instance->proxyFactory();
+ if(proxyFactory)
+ {
+ proxyFactory->checkRetryAfterException(exc, _cnt);
+ }
+ else
+ {
+ exc.ice_throw(); // The communicator is already destroyed, so we cannot retry.
+ }
+
+ doRetry = true;
}
- else
+ catch(const LocalException&)
{
- exc.ice_throw(); // The communicator is already destroyed, so we cannot retry.
}
-
- doRetry = true;
}
- catch(const LocalException&)
+
+ if(doRetry)
{
+ _connection = 0;
+ __send();
+ return;
}
}
-
- if(doRetry)
- {
- _connection = 0;
- __send();
- return;
- }
try
{