@@ -1384,7 +1384,7 @@ redis_key_prefix(RedisSock *redis_sock, char **key, int *key_len TSRMLS_DC) {
1384
1384
*/
1385
1385
1386
1386
PHPAPI int
1387
- redis_sock_gets (RedisSock * redis_sock , char * buf , int buf_size , size_t * line_size ) {
1387
+ redis_sock_gets (RedisSock * redis_sock , char * buf , int buf_size , size_t * line_size TSRMLS_DC ) {
1388
1388
// Handle EOF
1389
1389
if (-1 == redis_check_eof (redis_sock TSRMLS_CC )) {
1390
1390
return -1 ;
@@ -1412,7 +1412,7 @@ redis_sock_gets(RedisSock *redis_sock, char *buf, int buf_size, size_t *line_siz
1412
1412
}
1413
1413
1414
1414
PHPAPI int
1415
- redis_read_reply_type (RedisSock * redis_sock , REDIS_REPLY_TYPE * reply_type , int * reply_info ) {
1415
+ redis_read_reply_type (RedisSock * redis_sock , REDIS_REPLY_TYPE * reply_type , int * reply_info TSRMLS_DC ) {
1416
1416
// Make sure we haven't lost the connection, even trying to reconnect
1417
1417
if (-1 == redis_check_eof (redis_sock TSRMLS_CC )) {
1418
1418
// Failure
@@ -1446,13 +1446,13 @@ redis_read_reply_type(RedisSock *redis_sock, REDIS_REPLY_TYPE *reply_type, int *
1446
1446
* Read a single line response, having already consumed the reply-type byte
1447
1447
*/
1448
1448
PHPAPI int
1449
- redis_read_variant_line (RedisSock * redis_sock , REDIS_REPLY_TYPE reply_type , zval * * z_ret ) {
1449
+ redis_read_variant_line (RedisSock * redis_sock , REDIS_REPLY_TYPE reply_type , zval * * z_ret TSRMLS_DC ) {
1450
1450
// Buffer to read our single line reply
1451
1451
char inbuf [1024 ];
1452
1452
size_t line_size ;
1453
1453
1454
1454
// Attempt to read our single line reply
1455
- if (redis_sock_gets (redis_sock , inbuf , sizeof (inbuf ), & line_size ) < 0 ) {
1455
+ if (redis_sock_gets (redis_sock , inbuf , sizeof (inbuf ), & line_size TSRMLS_CC ) < 0 ) {
1456
1456
return -1 ;
1457
1457
}
1458
1458
@@ -1476,9 +1476,9 @@ redis_read_variant_line(RedisSock *redis_sock, REDIS_REPLY_TYPE reply_type, zval
1476
1476
}
1477
1477
1478
1478
PHPAPI int
1479
- redis_read_variant_bulk (RedisSock * redis_sock , int size , zval * * z_ret ) {
1479
+ redis_read_variant_bulk (RedisSock * redis_sock , int size , zval * * z_ret TSRMLS_DC ) {
1480
1480
// Attempt to read the bulk reply
1481
- char * bulk_resp = redis_sock_read_bulk_reply (redis_sock , size );
1481
+ char * bulk_resp = redis_sock_read_bulk_reply (redis_sock , size TSRMLS_CC );
1482
1482
1483
1483
// Set our reply to FALSE on failure, and the string on success
1484
1484
if (bulk_resp == NULL ) {
@@ -1491,15 +1491,15 @@ redis_read_variant_bulk(RedisSock *redis_sock, int size, zval **z_ret) {
1491
1491
}
1492
1492
1493
1493
PHPAPI int
1494
- redis_read_multibulk_recursive (RedisSock * redis_sock , int elements , zval * * z_ret ) {
1494
+ redis_read_multibulk_recursive (RedisSock * redis_sock , int elements , zval * * z_ret TSRMLS_DC ) {
1495
1495
int reply_info ;
1496
1496
REDIS_REPLY_TYPE reply_type ;
1497
1497
zval * z_subelem ;
1498
1498
1499
1499
// Iterate while we have elements
1500
1500
while (elements > 0 ) {
1501
1501
// Attempt to read our reply type
1502
- if (redis_read_reply_type (redis_sock , & reply_type , & reply_info ) < 0 ) {
1502
+ if (redis_read_reply_type (redis_sock , & reply_type , & reply_info TSRMLS_CC ) < 0 ) {
1503
1503
zend_throw_exception_ex (redis_exception_ce , 0 TSRMLS_CC , "protocol error, couldn't parse MULTI-BULK response\n" , reply_type );
1504
1504
return -1 ;
1505
1505
}
@@ -1509,7 +1509,7 @@ redis_read_multibulk_recursive(RedisSock *redis_sock, int elements, zval **z_ret
1509
1509
case TYPE_ERR :
1510
1510
case TYPE_LINE :
1511
1511
ALLOC_INIT_ZVAL (z_subelem );
1512
- redis_read_variant_line (redis_sock , reply_type , & z_subelem );
1512
+ redis_read_variant_line (redis_sock , reply_type , & z_subelem TSRMLS_CC );
1513
1513
add_next_index_zval (* z_ret , z_subelem );
1514
1514
break ;
1515
1515
case TYPE_INT :
@@ -1519,15 +1519,15 @@ redis_read_multibulk_recursive(RedisSock *redis_sock, int elements, zval **z_ret
1519
1519
case TYPE_BULK :
1520
1520
// Init a zval for our bulk response, read and add it
1521
1521
ALLOC_INIT_ZVAL (z_subelem );
1522
- redis_read_variant_bulk (redis_sock , reply_info , & z_subelem );
1522
+ redis_read_variant_bulk (redis_sock , reply_info , & z_subelem TSRMLS_CC );
1523
1523
add_next_index_zval (* z_ret , z_subelem );
1524
1524
break ;
1525
1525
case TYPE_MULTIBULK :
1526
1526
// Construct an array for our sub element, and add it, and recurse
1527
1527
ALLOC_INIT_ZVAL (z_subelem );
1528
1528
array_init (z_subelem );
1529
1529
add_next_index_zval (* z_ret , z_subelem );
1530
- redis_read_multibulk_recursive (redis_sock , reply_info , & z_subelem );
1530
+ redis_read_multibulk_recursive (redis_sock , reply_info , & z_subelem TSRMLS_CC );
1531
1531
break ;
1532
1532
}
1533
1533
@@ -1547,7 +1547,7 @@ redis_read_variant_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zv
1547
1547
zval * z_ret ;
1548
1548
1549
1549
// Attempt to read our header
1550
- if (redis_read_reply_type (redis_sock , & reply_type , & reply_info ) < 0 ) {
1550
+ if (redis_read_reply_type (redis_sock , & reply_type , & reply_info TSRMLS_CC ) < 0 ) {
1551
1551
return -1 ;
1552
1552
}
1553
1553
@@ -1558,21 +1558,21 @@ redis_read_variant_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zv
1558
1558
switch (reply_type ) {
1559
1559
case TYPE_ERR :
1560
1560
case TYPE_LINE :
1561
- redis_read_variant_line (redis_sock , reply_type , & z_ret );
1561
+ redis_read_variant_line (redis_sock , reply_type , & z_ret TSRMLS_CC );
1562
1562
break ;
1563
1563
case TYPE_INT :
1564
1564
ZVAL_LONG (z_ret , reply_info );
1565
1565
break ;
1566
1566
case TYPE_BULK :
1567
- redis_read_variant_bulk (redis_sock , reply_info , & z_ret );
1567
+ redis_read_variant_bulk (redis_sock , reply_info , & z_ret TSRMLS_CC );
1568
1568
break ;
1569
1569
case TYPE_MULTIBULK :
1570
1570
// Initialize an array for our multi-bulk response
1571
1571
array_init (z_ret );
1572
1572
1573
1573
// If we've got more than zero elements, parse our multi bulk respoinse recursively
1574
1574
if (reply_info > -1 ) {
1575
- redis_read_multibulk_recursive (redis_sock , reply_info , & z_ret );
1575
+ redis_read_multibulk_recursive (redis_sock , reply_info , & z_ret TSRMLS_CC );
1576
1576
}
1577
1577
break ;
1578
1578
default :
0 commit comments