summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/OutgoingAsync.h6
-rw-r--r--cpp/src/Ice/OutgoingAsync.cpp23
-rw-r--r--cpp/src/slice2cpp/Gen.cpp10
-rwxr-xr-xcpp/src/slice2cs/Gen.cpp8
-rw-r--r--cpp/src/slice2java/Gen.cpp8
-rwxr-xr-xcpp/src/slice2vb/Gen.cpp8
6 files changed, 36 insertions, 27 deletions
diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h
index 5b5a232c5cb..f589790ebf9 100644
--- a/cpp/include/Ice/OutgoingAsync.h
+++ b/cpp/include/Ice/OutgoingAsync.h
@@ -36,14 +36,14 @@ public:
virtual void ice_exception(const Ice::Exception&) = 0;
void __finished(BasicStream&);
- void __finished(const Ice::LocalException&);
+ bool __finished(const Ice::LocalException&);
protected:
void __prepare(const Ice::ObjectPrx&, const std::string&, Ice::OperationMode, const Ice::Context&);
void __send();
- virtual void __response(bool) = 0;
+ virtual bool __response(bool) = 0;
BasicStream* __is;
BasicStream* __os;
@@ -82,7 +82,7 @@ public:
protected:
- virtual void __response(bool);
+ virtual bool __response(bool);
};
}
diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp
index 736d4b4f28b..c335120934b 100644
--- a/cpp/src/Ice/OutgoingAsync.cpp
+++ b/cpp/src/Ice/OutgoingAsync.cpp
@@ -177,9 +177,14 @@ IceInternal::OutgoingAsync::__finished(BasicStream& is)
assert(status == DispatchOK || status == DispatchUserException);
+ //
+ // It is possible for __response to trigger a retry.
+ // If it does we must not perform a cleanup.
+ //
+ bool retry = false;
try
{
- __response(status == DispatchOK);
+ retry = __response(status == DispatchOK);
}
catch(const Exception& ex)
{
@@ -194,10 +199,13 @@ IceInternal::OutgoingAsync::__finished(BasicStream& is)
warning();
}
- cleanup();
+ if(!retry)
+ {
+ cleanup();
+ }
}
-void
+bool
IceInternal::OutgoingAsync::__finished(const LocalException& exc)
{
IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(_monitor);
@@ -244,7 +252,7 @@ IceInternal::OutgoingAsync::__finished(const LocalException& exc)
{
_connection = 0;
__send();
- return;
+ return true;
}
}
@@ -266,6 +274,7 @@ IceInternal::OutgoingAsync::__finished(const LocalException& exc)
}
cleanup();
+ return false;
}
void
@@ -461,7 +470,7 @@ Ice::AMI_Object_ice_invoke::__invoke(const ObjectPrx& prx, const string& operati
__send();
}
-void
+bool
Ice::AMI_Object_ice_invoke::__response(bool ok) // ok == true means no user exception.
{
vector<Byte> outParams;
@@ -472,8 +481,8 @@ Ice::AMI_Object_ice_invoke::__response(bool ok) // ok == true means no user exce
}
catch(const LocalException& ex)
{
- __finished(ex);
- return;
+ return __finished(ex);
}
ice_response(ok, outParams);
+ return false;
}
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 0691a80505c..930fee15337 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -4143,7 +4143,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
H << nl << "protected:";
H.inc();
H << sp;
- H << nl << "virtual void __response(bool);";
+ H << nl << "virtual bool __response(bool);";
H << eb << ';';
H << sp << nl << "typedef ::IceUtil::Handle< " << classScopedAMI << '_' << name << "> " << classNameAMI
<< '_' << name << "Ptr;";
@@ -4173,7 +4173,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
C << nl << "__send();";
C << eb;
- C << sp << nl << "void" << nl << classScopedAMI.substr(2) << '_' << name << "::__response(bool __ok)";
+ C << sp << nl << "bool" << nl << classScopedAMI.substr(2) << '_' << name << "::__response(bool __ok)";
C << sb;
writeAllocateCode(C, outParams, ret);
C << nl << "try";
@@ -4202,7 +4202,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
C << nl << "catch(const " << fixKwd((*i)->scoped()) << "& __ex)";
C << sb;
C << nl << "ice_exception(__ex);";
- C << nl << "return;";
+ C << nl << "return false;";
C << eb;
}
C << nl << "catch(const ::Ice::UserException& __ex)";
@@ -4219,10 +4219,10 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
C << eb;
C << nl << "catch(const ::Ice::LocalException& __ex)";
C << sb;
- C << nl << "__finished(__ex);";
- C << nl << "return;";
+ C << nl << "return __finished(__ex);";
C << eb;
C << nl << "ice_response" << spar << args << epar << ';';
+ C << nl << "return false;";
C << eb;
}
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index bd9132b0fe2..f4076043d09 100755
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -4304,7 +4304,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
_out << nl << "__send();";
_out << eb;
- _out << sp << nl << "protected override void __response(bool __ok)";
+ _out << sp << nl << "protected override bool __response(bool __ok)";
_out << sb;
for(q = outParams.begin(); q != outParams.end(); ++q)
{
@@ -4386,18 +4386,18 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
_out << eb;
_out << nl << "catch(Ice.LocalException __ex)";
_out << sb;
- _out << nl << "__finished(__ex);";
- _out << nl << "return;";
+ _out << nl << "return __finished(__ex);";
_out << eb;
if(!throws.empty())
{
_out << nl << "catch(Ice.UserException __ex)";
_out << sb;
_out << nl << "ice_exception(__ex);";
- _out << nl << "return;";
+ _out << nl << "return false;";
_out << eb;
}
_out << nl << "ice_response" << spar << args << epar << ';';
+ _out << nl << "return false;";
_out << eb;
_out << eb;
}
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index b32e85a4e08..a6a6208639f 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -4438,7 +4438,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << nl << "__send();";
out << eb;
- out << sp << nl << "protected final void" << nl << "__response(boolean __ok)";
+ out << sp << nl << "protected final boolean" << nl << "__response(boolean __ok)";
out << sb;
for(pli = outParams.begin(); pli != outParams.end(); ++pli)
{
@@ -4481,7 +4481,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << nl << "catch(" << getAbsolute(*r, classPkg) << " __ex)";
out << sb;
out << nl << "ice_exception(__ex);";
- out << nl << "return;";
+ out << nl << "return false;";
out << eb;
}
out << nl << "catch(Ice.UserException __ex)";
@@ -4523,10 +4523,10 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
out << eb;
out << nl << "catch(Ice.LocalException __ex)";
out << sb;
- out << nl << "__finished(__ex);";
- out << nl << "return;";
+ out << nl << "return __finished(__ex);";
out << eb;
out << nl << "ice_response" << spar << args << epar << ';';
+ out << nl << "return false;";
out << eb;
out << eb;
diff --git a/cpp/src/slice2vb/Gen.cpp b/cpp/src/slice2vb/Gen.cpp
index 504c461932e..7bd01a9bede 100755
--- a/cpp/src/slice2vb/Gen.cpp
+++ b/cpp/src/slice2vb/Gen.cpp
@@ -4838,7 +4838,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
_out.dec();
_out << nl << "End Sub";
- _out << sp << nl << "Protected Overrides Sub __response(__ok As Boolean)";
+ _out << sp << nl << "Protected Overrides Sub __response(__ok As Boolean) As Boolean";
_out.inc();
for(q = outParams.begin(); q != outParams.end(); ++q)
{
@@ -4922,19 +4922,19 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
_out.dec();
_out << nl << "Catch __ex As Ice.LocalException";
_out.inc();
- _out << nl << "__finished(__ex)";
- _out << nl << "Return";
+ _out << nl << "Return __finished(__ex)";
_out.dec();
if(!throws.empty())
{
_out << nl << "Catch __ex As Ice.UserException";
_out.inc();
_out << nl << "ice_exception(__ex)";
- _out << nl << "Return";
+ _out << nl << "Return False";
_out.dec();
}
_out << nl << "End Try";
_out << nl << "ice_response" << spar << args << epar;
+ _out << nl << "Return False";
_out.dec();
_out << nl << "End Sub";
_out.dec();