From bcd2c2d1b01e721be924b96247be86384ddc9738 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 11 Jul 2019 17:42:59 +0200 Subject: Fixed dispatcher interceptor bug #435 --- cpp/src/Ice/DispatchInterceptor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cpp/src/Ice/DispatchInterceptor.cpp') diff --git a/cpp/src/Ice/DispatchInterceptor.cpp b/cpp/src/Ice/DispatchInterceptor.cpp index 10457e990e9..ae12e77f900 100644 --- a/cpp/src/Ice/DispatchInterceptor.cpp +++ b/cpp/src/Ice/DispatchInterceptor.cpp @@ -21,4 +21,17 @@ Ice::DispatchInterceptor::_iceDispatch(IceInternal::Incoming& in, const Current& { return false; } + catch(const std::exception&) + { + // + // If the input parameters weren't read, make sure we skip them here. It's needed to read the + // encoding version used by the client to eventually marshal the user exception. It's also needed + // if we are dispatch a batch oneway request to read the next batch request. + // + if(in.getCurrent().encoding.major == 0 && in.getCurrent().encoding.minor == 0) + { + in.skipReadParams(); + } + throw; + } } -- cgit v1.2.3 From 3184f261238e75470e18fd9441524eddcb4847df Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 11 Jul 2019 18:19:52 +0200 Subject: Fixed C++11 issue with previous Ice/interceptor test fix --- cpp/src/Ice/DispatchInterceptor.cpp | 2 +- cpp/test/Ice/interceptor/Client.cpp | 6 +++--- csharp/src/Ice/DispatchInterceptor.cs | 2 +- java-compat/src/Ice/src/main/java/Ice/DispatchInterceptor.java | 2 +- java/src/Ice/src/main/java/com/zeroc/Ice/DispatchInterceptor.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'cpp/src/Ice/DispatchInterceptor.cpp') diff --git a/cpp/src/Ice/DispatchInterceptor.cpp b/cpp/src/Ice/DispatchInterceptor.cpp index ae12e77f900..78e79311631 100644 --- a/cpp/src/Ice/DispatchInterceptor.cpp +++ b/cpp/src/Ice/DispatchInterceptor.cpp @@ -26,7 +26,7 @@ Ice::DispatchInterceptor::_iceDispatch(IceInternal::Incoming& in, const Current& // // If the input parameters weren't read, make sure we skip them here. It's needed to read the // encoding version used by the client to eventually marshal the user exception. It's also needed - // if we are dispatch a batch oneway request to read the next batch request. + // if we dispatch a batch oneway request to read the next batch request. // if(in.getCurrent().encoding.major == 0 && in.getCurrent().encoding.minor == 0) { diff --git a/cpp/test/Ice/interceptor/Client.cpp b/cpp/test/Ice/interceptor/Client.cpp index dc93891e819..d47dc7abc22 100644 --- a/cpp/test/Ice/interceptor/Client.cpp +++ b/cpp/test/Ice/interceptor/Client.cpp @@ -35,7 +35,7 @@ private: void runTest(const Test::MyObjectPrxPtr&, const InterceptorIPtr&); void runAmdTest(const Test::MyObjectPrxPtr&, const AMDInterceptorIPtr&); - void testInterceptorExceptions(const Test::MyObjectPrx&); + void testInterceptorExceptions(const Test::MyObjectPrxPtr&); }; void @@ -246,7 +246,7 @@ Client::runAmdTest(const Test::MyObjectPrxPtr& prx, const AMDInterceptorIPtr& in } void -Client::testInterceptorExceptions(const Test::MyObjectPrx& prx) +Client::testInterceptorExceptions(const Test::MyObjectPrxPtr& prx) { vector > exceptions; exceptions.push_back(make_pair("raiseBeforeDispatch", "user")); @@ -281,7 +281,7 @@ Client::testInterceptorExceptions(const Test::MyObjectPrx& prx) test(p->second == "system"); // collocated } { - Ice::ObjectPrx batch = prx->ice_batchOneway(); + Ice::ObjectPrxPtr batch = prx->ice_batchOneway(); batch->ice_ping(ctx); batch->ice_ping(); batch->ice_flushBatchRequests(); diff --git a/csharp/src/Ice/DispatchInterceptor.cs b/csharp/src/Ice/DispatchInterceptor.cs index 58a63672bd3..54e39251ac6 100644 --- a/csharp/src/Ice/DispatchInterceptor.cs +++ b/csharp/src/Ice/DispatchInterceptor.cs @@ -35,7 +35,7 @@ namespace Ice // // If the input parameters weren't read, make sure we skip them here. It's needed to read the // encoding version used by the client to eventually marshal the user exception. It's also needed - // if we are dispatch a batch oneway request to read the next batch request. + // if we dispatch a batch oneway request to read the next batch request. // if(current.encoding == null || (current.encoding.major == 0 && current.encoding.minor == 0)) { diff --git a/java-compat/src/Ice/src/main/java/Ice/DispatchInterceptor.java b/java-compat/src/Ice/src/main/java/Ice/DispatchInterceptor.java index 3935de43b3e..355e81dd354 100644 --- a/java-compat/src/Ice/src/main/java/Ice/DispatchInterceptor.java +++ b/java-compat/src/Ice/src/main/java/Ice/DispatchInterceptor.java @@ -48,7 +48,7 @@ public abstract class DispatchInterceptor extends ObjectImpl // // If the input parameters weren't read, make sure we skip them here. It's needed to read the // encoding version used by the client to eventually marshal the user exception. It's also needed - // if we are dispatch a batch oneway request to read the next batch request. + // if we dispatch a batch oneway request to read the next batch request. // if(current.encoding == null || (current.encoding.major == 0 && current.encoding.minor == 0)) { diff --git a/java/src/Ice/src/main/java/com/zeroc/Ice/DispatchInterceptor.java b/java/src/Ice/src/main/java/com/zeroc/Ice/DispatchInterceptor.java index b5f23bb9c27..8523bdc929d 100644 --- a/java/src/Ice/src/main/java/com/zeroc/Ice/DispatchInterceptor.java +++ b/java/src/Ice/src/main/java/com/zeroc/Ice/DispatchInterceptor.java @@ -45,7 +45,7 @@ public abstract class DispatchInterceptor implements com.zeroc.Ice.Object // // If the input parameters weren't read, make sure we skip them here. It's needed to read the // encoding version used by the client to eventually marshal the user exception. It's also needed - // if we are dispatch a batch oneway request to read the next batch request. + // if we dispatch a batch oneway request to read the next batch request. // if(current.encoding == null || (current.encoding.major == 0 && current.encoding.minor == 0)) { -- cgit v1.2.3