diff options
author | Jose <jose@zeroc.com> | 2019-07-18 23:51:08 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-07-18 23:51:08 +0200 |
commit | fc886b010c01cccb8cca3ac4d92f1ebd7fc72295 (patch) | |
tree | 51cf00a4a955efecc9c94527aeafcb25ffbe57b9 /cpp/src/Ice | |
parent | Simplify OutputStream creation (diff) | |
parent | Fixed non-thread safe AMD dispatch, fixes #448 (#449) (diff) | |
download | ice-fc886b010c01cccb8cca3ac4d92f1ebd7fc72295.tar.bz2 ice-fc886b010c01cccb8cca3ac4d92f1ebd7fc72295.tar.xz ice-fc886b010c01cccb8cca3ac4d92f1ebd7fc72295.zip |
Merge remote-tracking branch 'origin/3.7' into swift
Diffstat (limited to 'cpp/src/Ice')
-rw-r--r-- | cpp/src/Ice/DispatchInterceptor.cpp | 13 | ||||
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Object.cpp | 9 |
3 files changed, 23 insertions, 1 deletions
diff --git a/cpp/src/Ice/DispatchInterceptor.cpp b/cpp/src/Ice/DispatchInterceptor.cpp index 10457e990e9..78e79311631 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 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; + } } diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 1fce4e5f107..b7cc91488d2 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -59,6 +59,8 @@ IceInternal::IncomingBase::IncomingBase(Instance* instance, ResponseHandler* res _current.con = connection; #endif _current.requestId = requestId; + _current.encoding.major = 0; + _current.encoding.minor = 0; } IceInternal::IncomingBase::IncomingBase(IncomingBase& other) : diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index effce176db2..78235ce4d62 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -155,7 +155,14 @@ Ice::Object::_iceD_ice_ids(Incoming& inS, const Current& current) inS.readEmptyParams(); vector<string> ret = ice_ids(current); OutputStream* ostr = inS.startWriteParams(); - ostr->write(&ret[0], &ret[0] + ret.size(), false); + if(ret.empty()) + { + ostr->write(ret); + } + else + { + ostr->write(&ret[0], &ret[0] + ret.size(), false); + } inS.endWriteParams(); return true; } |