diff options
-rw-r--r-- | cpp/include/Ice/OutgoingAsync.h | 6 | ||||
-rw-r--r-- | cpp/src/Ice/OutgoingAsync.cpp | 23 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 10 | ||||
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 8 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 8 | ||||
-rwxr-xr-x | cpp/src/slice2vb/Gen.cpp | 4 | ||||
-rwxr-xr-x | cs/src/Ice/OutgoingAsync.cs | 21 |
7 files changed, 33 insertions, 47 deletions
diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index f589790ebf9..5b5a232c5cb 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&); - bool __finished(const Ice::LocalException&); + void __finished(const Ice::LocalException&); protected: void __prepare(const Ice::ObjectPrx&, const std::string&, Ice::OperationMode, const Ice::Context&); void __send(); - virtual bool __response(bool) = 0; + virtual void __response(bool) = 0; BasicStream* __is; BasicStream* __os; @@ -82,7 +82,7 @@ public: protected: - virtual bool __response(bool); + virtual void __response(bool); }; } diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index c335120934b..736d4b4f28b 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -177,14 +177,9 @@ 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 { - retry = __response(status == DispatchOK); + __response(status == DispatchOK); } catch(const Exception& ex) { @@ -199,13 +194,10 @@ IceInternal::OutgoingAsync::__finished(BasicStream& is) warning(); } - if(!retry) - { - cleanup(); - } + cleanup(); } -bool +void IceInternal::OutgoingAsync::__finished(const LocalException& exc) { IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(_monitor); @@ -252,7 +244,7 @@ IceInternal::OutgoingAsync::__finished(const LocalException& exc) { _connection = 0; __send(); - return true; + return; } } @@ -274,7 +266,6 @@ IceInternal::OutgoingAsync::__finished(const LocalException& exc) } cleanup(); - return false; } void @@ -470,7 +461,7 @@ Ice::AMI_Object_ice_invoke::__invoke(const ObjectPrx& prx, const string& operati __send(); } -bool +void Ice::AMI_Object_ice_invoke::__response(bool ok) // ok == true means no user exception. { vector<Byte> outParams; @@ -481,8 +472,8 @@ Ice::AMI_Object_ice_invoke::__response(bool ok) // ok == true means no user exce } catch(const LocalException& ex) { - return __finished(ex); + __finished(ex); + return; } ice_response(ok, outParams); - return false; } diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 930fee15337..0691a80505c 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 bool __response(bool);"; + H << nl << "virtual void __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 << "bool" << nl << classScopedAMI.substr(2) << '_' << name << "::__response(bool __ok)"; + C << sp << nl << "void" << 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 false;"; + C << nl << "return;"; 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 << "return __finished(__ex);"; + C << nl << "__finished(__ex);"; + C << nl << "return;"; 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 f4076043d09..bd9132b0fe2 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 bool __response(bool __ok)"; + _out << sp << nl << "protected override void __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 << "return __finished(__ex);"; + _out << nl << "__finished(__ex);"; + _out << nl << "return;"; _out << eb; if(!throws.empty()) { _out << nl << "catch(Ice.UserException __ex)"; _out << sb; _out << nl << "ice_exception(__ex);"; - _out << nl << "return false;"; + _out << nl << "return;"; _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 a6a6208639f..b32e85a4e08 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 boolean" << nl << "__response(boolean __ok)"; + out << sp << nl << "protected final void" << 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 false;"; + out << nl << "return;"; 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 << "return __finished(__ex);"; + out << nl << "__finished(__ex);"; + out << nl << "return;"; 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 7e59807ec95..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 Function __response(__ok As Boolean) As Boolean"; + _out << sp << nl << "Protected Overrides Sub __response(__ok As Boolean) As Boolean"; _out.inc(); for(q = outParams.begin(); q != outParams.end(); ++q) { @@ -4936,7 +4936,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) _out << nl << "ice_response" << spar << args << epar; _out << nl << "Return False"; _out.dec(); - _out << nl << "End Function"; + _out << nl << "End Sub"; _out.dec(); _out << nl << "End Class"; } diff --git a/cs/src/Ice/OutgoingAsync.cs b/cs/src/Ice/OutgoingAsync.cs index 96d68275de5..1a502c3f783 100755 --- a/cs/src/Ice/OutgoingAsync.cs +++ b/cs/src/Ice/OutgoingAsync.cs @@ -149,10 +149,9 @@ namespace IceInternal Debug.Assert(status == DispatchStatus.DispatchOK || status == DispatchStatus.DispatchUserException); - bool retry = false; try { - retry = __response(status == DispatchStatus.DispatchOK); + __response(status == DispatchStatus.DispatchOK); } catch(System.Exception ex) { @@ -160,15 +159,12 @@ namespace IceInternal } finally { - if(!retry) - { - cleanup(); - } + cleanup(); } } } - public bool __finished(Ice.LocalException exc) + public void __finished(Ice.LocalException exc) { lock(_monitor) { @@ -215,7 +211,7 @@ namespace IceInternal { _connection = null; __send(); - return true; + return; } } @@ -231,7 +227,6 @@ namespace IceInternal { cleanup(); } - return false; } } @@ -406,7 +401,7 @@ namespace IceInternal } } - protected abstract bool __response(bool ok); + protected abstract void __response(bool ok); private void warning(System.Exception ex) { @@ -471,7 +466,7 @@ namespace Ice __send(); } - protected override bool __response(bool ok) // ok == true means no user exception. + protected override void __response(bool ok) // ok == true means no user exception. { byte[] outParams; try @@ -481,10 +476,10 @@ namespace Ice } catch(LocalException ex) { - return __finished(ex); + __finished(ex); + return; } ice_response(ok, outParams); - return false; } } |