@@ -299,9 +299,8 @@ static int cluster_send_readonly(RedisSock *redis_sock) {
299299
300300/* Send MULTI to a specific ReidsSock */
301301static int cluster_send_multi (redisCluster * c , short slot ) {
302- if (cluster_send_direct (SLOT_SOCK (c ,slot ), RESP_MULTI_CMD ,
303- sizeof (RESP_MULTI_CMD ) - 1 , TYPE_LINE ) == 0 )
304- {
302+ if (cluster_send_direct (SLOT_SOCK (c ,slot ), ZEND_STRL (RESP_MULTI_CMD ), TYPE_LINE ) == 0 ) {
303+ c -> flags -> txBytes += sizeof (RESP_MULTI_CMD ) - 1 ;
305304 c -> cmd_sock -> mode = MULTI ;
306305 return 0 ;
307306 }
@@ -1513,6 +1512,9 @@ PHP_REDIS_API int cluster_send_slot(redisCluster *c, short slot, char *cmd,
15131512 /* Point our cluster to this slot and it's socket */
15141513 c -> cmd_slot = slot ;
15151514 c -> cmd_sock = SLOT_SOCK (c , slot );
1515+ if (c -> flags -> mode != MULTI ) {
1516+ c -> flags -> txBytes = 0 ;
1517+ }
15161518
15171519 /* Enable multi mode on this slot if we've been directed to but haven't
15181520 * send it to this node yet */
@@ -1527,6 +1529,7 @@ PHP_REDIS_API int cluster_send_slot(redisCluster *c, short slot, char *cmd,
15271529 if (cluster_sock_write (c , cmd , cmd_len , 1 ) == -1 ) {
15281530 return -1 ;
15291531 }
1532+ c -> flags -> txBytes += cmd_len ;
15301533
15311534 /* Check our response */
15321535 if (cluster_check_response (c , & c -> reply_type ) != 0 ||
0 commit comments