From 18ab8207bd14def950fd399c60d9ee54fab75d3b Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 6 Feb 2017 11:17:34 +0100 Subject: Fixed ICE-7169 and ICE-7375 - add option to specify if batch requests flushed with the communicator/connection should be compressed --- php/src/php5/Communicator.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'php/src/php5/Communicator.cpp') diff --git a/php/src/php5/Communicator.cpp b/php/src/php5/Communicator.cpp index c22723e53d7..964a255599d 100644 --- a/php/src/php5/Communicator.cpp +++ b/php/src/php5/Communicator.cpp @@ -807,17 +807,25 @@ ZEND_METHOD(Ice_Communicator, setDefaultLocator) ZEND_METHOD(Ice_Communicator, flushBatchRequests) { - CommunicatorInfoIPtr _this = Wrapper::value(getThis() TSRMLS_CC); - assert(_this); + zval* compress; + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, const_cast("z"), &compress TSRMLS_CC) != SUCCESS) + { + RETURN_NULL(); + } - if(ZEND_NUM_ARGS() != 8) + if(Z_TYPE_P(compress) != IS_LONG) { - WRONG_PARAM_COUNT; + invalidArgument("value for 'compress' argument must be an enumerator of CompressBatch" TSRMLS_CC); + RETURN_NULL(); } + Ice::CompressBatch cb = static_cast(Z_LVAL_P(compress)); + + CommunicatorInfoIPtr _this = Wrapper::value(getThis() TSRMLS_CC); + assert(_this); try { - _this->getCommunicator()->flushBatchRequests(); + _this->getCommunicator()->flushBatchRequests(cb); } catch(const IceUtil::Exception& ex) { -- cgit v1.2.3