summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Outgoing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/Outgoing.cpp')
-rw-r--r--cpp/src/Ice/Outgoing.cpp39
1 files changed, 4 insertions, 35 deletions
diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp
index 914b84f4708..e5b0e833de7 100644
--- a/cpp/src/Ice/Outgoing.cpp
+++ b/cpp/src/Ice/Outgoing.cpp
@@ -98,10 +98,10 @@ IceInternal::Outgoing::Outgoing(RequestHandler* handler, const string& operation
{
try
{
- _observer = resolver->getInvocationObserver(ref->getInstance()->proxyFactory()->referenceToProxy(ref),
- operation,
- *context,
- handler->getConnection(false));
+ _observer.attach(resolver->getInvocationObserver(ref->getInstance()->proxyFactory()->referenceToProxy(ref),
+ operation,
+ *context,
+ handler->getConnection(false)));
}
catch(const Ice::LocalException&)
{
@@ -110,11 +110,6 @@ IceInternal::Outgoing::Outgoing(RequestHandler* handler, const string& operation
// the request will be re-tried in this case.
//
}
-
- if(_observer)
- {
- _observer->attach();
- }
}
switch(ref->getMode())
@@ -188,10 +183,6 @@ IceInternal::Outgoing::Outgoing(RequestHandler* handler, const string& operation
Outgoing::~Outgoing()
{
- if(_observer)
- {
- _observer->detach();
- }
}
bool
@@ -404,20 +395,12 @@ IceInternal::Outgoing::finished(BasicStream& is)
{
case replyOK:
{
- if(_observer)
- {
- _observer->responseOK();
- }
_state = StateOK; // The state must be set last, in case there is an exception.
break;
}
case replyUserException:
{
- if(_observer)
- {
- _observer->responseUserException();
- }
_state = StateUserException; // The state must be set last, in case there is an exception.
break;
}
@@ -426,11 +409,6 @@ IceInternal::Outgoing::finished(BasicStream& is)
case replyFacetNotExist:
case replyOperationNotExist:
{
- if(_observer)
- {
- _observer->responseRequestFailedException();
- }
-
//
// Don't read the exception members directly into the
// exception. Otherwise if reading fails and raises an
@@ -499,11 +477,6 @@ IceInternal::Outgoing::finished(BasicStream& is)
case replyUnknownLocalException:
case replyUnknownUserException:
{
- if(_observer)
- {
- _observer->responseUnknownException();
- }
-
//
// Don't read the exception members directly into the
// exception. Otherwise if reading fails and raises an
@@ -550,10 +523,6 @@ IceInternal::Outgoing::finished(BasicStream& is)
default:
{
- if(_observer)
- {
- _observer->responseUnknownException();
- }
_exception.reset(new UnknownReplyStatusException(__FILE__, __LINE__));
_state = StateLocalException;
break;