@@ -2828,6 +2828,7 @@ PHP_METHOD(RedisCluster, ping) {
2828
2828
* proto string RedisCluster::echo(array host_port, string msg) */
2829
2829
PHP_METHOD (RedisCluster , echo ) {
2830
2830
redisCluster * c = GET_CONTEXT ();
2831
+ REDIS_REPLY_TYPE rtype ;
2831
2832
zval * z_arg ;
2832
2833
char * cmd , * msg ;
2833
2834
int cmd_len , msg_len ;
@@ -2852,15 +2853,21 @@ PHP_METHOD(RedisCluster, echo) {
2852
2853
cmd_len = redis_cmd_format_static (& cmd , "ECHO" , "s" , msg , msg_len );
2853
2854
2854
2855
/* Send it off */
2855
- if (cluster_send_slot (c ,slot ,cmd ,cmd_len ,TYPE_BULK TSRMLS_CC )< 0 ) {
2856
+ rtype = CLUSTER_IS_ATOMIC (c ) ? TYPE_BULK : TYPE_LINE ;
2857
+ if (cluster_send_slot (c ,slot ,cmd ,cmd_len ,rtype TSRMLS_CC )< 0 ) {
2856
2858
zend_throw_exception (redis_cluster_exception_ce ,
2857
2859
"Unable to send commnad at the specificed node" , 0 TSRMLS_CC );
2858
2860
efree (cmd );
2859
2861
RETURN_FALSE ;
2860
2862
}
2861
2863
2862
2864
/* Process bulk response */
2863
- cluster_bulk_resp (INTERNAL_FUNCTION_PARAM_PASSTHRU , c , NULL );
2865
+ if (CLUSTER_IS_ATOMIC (c )) {
2866
+ cluster_bulk_resp (INTERNAL_FUNCTION_PARAM_PASSTHRU , c , NULL );
2867
+ } else {
2868
+ void * ctx = NULL ;
2869
+ CLUSTER_ENQUEUE_RESPONSE (c , slot , cluster_bulk_resp , ctx );
2870
+ }
2864
2871
2865
2872
efree (cmd );
2866
2873
}
0 commit comments