diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-07-27 01:47:43 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-07-27 01:47:43 +0000 |
commit | 6d1e32eebbbe320b3a1fe33552824a3f8982b6a0 (patch) | |
tree | ec67ad494b59bd2e8028f5b7e5b886394cb4e3b9 /cpp/src/Ice/Object.cpp | |
parent | Minor fix (diff) | |
download | ice-6d1e32eebbbe320b3a1fe33552824a3f8982b6a0.tar.bz2 ice-6d1e32eebbbe320b3a1fe33552824a3f8982b6a0.tar.xz ice-6d1e32eebbbe320b3a1fe33552824a3f8982b6a0.zip |
Partial fix for bug #1257: deprecating nonmutating
Diffstat (limited to 'cpp/src/Ice/Object.cpp')
-rw-r--r-- | cpp/src/Ice/Object.cpp | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 86795e52747..6e3d1765e9f 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -133,6 +133,13 @@ Ice::Object::___ice_id(Incoming& __inS, const Current& __current) return DispatchOK; } +Ice::Int +Ice::Object::ice_operationAttributes(const string&) const +{ + return 0; +} + + string Ice::Object::__all[] = { "ice_id", @@ -268,14 +275,29 @@ Ice::Object::__checkMode(OperationMode expected, OperationMode received) { if(expected != received) { - Ice::MarshalException ex(__FILE__, __LINE__); - std::ostringstream __reason; - __reason << "unexpected operation mode. expected = " - << operationModeToString(expected) - << " received = " - << operationModeToString(received); - ex.reason = __reason.str(); - throw ex; + if(expected == Idempotent && received == Nonmutating) + { + // + // Fine: typically an old client still using the deprecated nonmutating keyword + // + + // + // Note that expected == Nonmutating and received == Idempotent is not ok: + // the server may still use the deprecated nonmutating keyword to detect updates + // and the client should not break this (deprecated) feature. + // + } + else + { + Ice::MarshalException ex(__FILE__, __LINE__); + std::ostringstream __reason; + __reason << "unexpected operation mode. expected = " + << operationModeToString(expected) + << " received = " + << operationModeToString(received); + ex.reason = __reason.str(); + throw ex; + } } } |