diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-08-07 20:45:03 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-08-07 20:45:03 +0000 |
commit | c67aebac0b227c01ce6420ab88a80b9871336146 (patch) | |
tree | d0da866e51e4d5a398516212dd37dcd3d120c8b5 /php/src | |
parent | more build instructions (diff) | |
download | ice-c67aebac0b227c01ce6420ab88a80b9871336146.tar.bz2 ice-c67aebac0b227c01ce6420ab88a80b9871336146.tar.xz ice-c67aebac0b227c01ce6420ab88a80b9871336146.zip |
bug fix for oneway invocations
Diffstat (limited to 'php/src')
-rw-r--r-- | php/src/ice/proxy.cpp | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/php/src/ice/proxy.cpp b/php/src/ice/proxy.cpp index d1ae9d96bd3..6965deef1c9 100644 --- a/php/src/ice/proxy.cpp +++ b/php/src/ice/proxy.cpp @@ -1259,48 +1259,54 @@ IcePHP::Operation::invoke(INTERNAL_FUNCTION_PARAMETERS) bool status = _proxy->ice_invoke(_op->name(), mode, os.b, is.b, ctx); // - // Reset the input stream's iterator. + // Process the reply. // - is.i = is.b.begin(); - - if(status) + if(_proxy->ice_isTwoway()) { // - // Unmarshal the results. - // - // TODO: Check for oneway/datagram errors + // Reset the input stream's iterator. // - for(i = _inParams.size(), p = _outParams.begin(); p != _outParams.end(); ++i, ++p) + is.i = is.b.begin(); + + if(status) { // - // We must explicitly destroy the existing contents of all zvals passed - // as out parameters, otherwise leaks occur. + // Unmarshal the results. // - zval_dtor(*args[i]); - if(!(*p)->unmarshal(*args[i], is TSRMLS_CC)) + // TODO: Check for oneway/datagram errors + // + for(i = _inParams.size(), p = _outParams.begin(); p != _outParams.end(); ++i, ++p) { - return; + // + // We must explicitly destroy the existing contents of all zvals passed + // as out parameters, otherwise leaks occur. + // + zval_dtor(*args[i]); + if(!(*p)->unmarshal(*args[i], is TSRMLS_CC)) + { + return; + } } - } - if(_result) - { - if(!_result->unmarshal(return_value, is TSRMLS_CC)) + if(_result) { - return; + if(!_result->unmarshal(return_value, is TSRMLS_CC)) + { + return; + } + } + if(_op->returnsClasses()) + { + is.readPendingObjects(); } } - if(_op->returnsClasses()) + else { - is.readPendingObjects(); + // + // Unmarshal and "throw" a user exception. + // + throwUserException(is TSRMLS_CC); } } - else - { - // - // Unmarshal and "throw" a user exception. - // - throwUserException(is TSRMLS_CC); - } } catch(const IceUtil::Exception& ex) { |