@@ -1374,7 +1374,7 @@ redis_key_prefix(RedisSock *redis_sock, char **key, int *key_len TSRMLS_DC) {
1374
1374
*/
1375
1375
1376
1376
PHPAPI int
1377
- redis_sock_gets (RedisSock * redis_sock , char * buf , int buf_size , size_t * line_size ) {
1377
+ redis_sock_gets (RedisSock * redis_sock , char * buf , int buf_size , size_t * line_size TSRMLS_DC ) {
1378
1378
// Handle EOF
1379
1379
if (-1 == redis_check_eof (redis_sock TSRMLS_CC )) {
1380
1380
return -1 ;
@@ -1402,7 +1402,7 @@ redis_sock_gets(RedisSock *redis_sock, char *buf, int buf_size, size_t *line_siz
1402
1402
}
1403
1403
1404
1404
PHPAPI int
1405
- redis_read_reply_type (RedisSock * redis_sock , REDIS_REPLY_TYPE * reply_type , int * reply_info ) {
1405
+ redis_read_reply_type (RedisSock * redis_sock , REDIS_REPLY_TYPE * reply_type , int * reply_info TSRMLS_DC ) {
1406
1406
// Make sure we haven't lost the connection, even trying to reconnect
1407
1407
if (-1 == redis_check_eof (redis_sock TSRMLS_CC )) {
1408
1408
// Failure
@@ -1436,13 +1436,13 @@ redis_read_reply_type(RedisSock *redis_sock, REDIS_REPLY_TYPE *reply_type, int *
1436
1436
* Read a single line response, having already consumed the reply-type byte
1437
1437
*/
1438
1438
PHPAPI int
1439
- redis_read_variant_line (RedisSock * redis_sock , REDIS_REPLY_TYPE reply_type , zval * * z_ret ) {
1439
+ redis_read_variant_line (RedisSock * redis_sock , REDIS_REPLY_TYPE reply_type , zval * * z_ret TSRMLS_DC ) {
1440
1440
// Buffer to read our single line reply
1441
1441
char inbuf [1024 ];
1442
1442
size_t line_size ;
1443
1443
1444
1444
// Attempt to read our single line reply
1445
- if (redis_sock_gets (redis_sock , inbuf , sizeof (inbuf ), & line_size ) < 0 ) {
1445
+ if (redis_sock_gets (redis_sock , inbuf , sizeof (inbuf ), & line_size TSRMLS_CC ) < 0 ) {
1446
1446
return -1 ;
1447
1447
}
1448
1448
@@ -1466,9 +1466,9 @@ redis_read_variant_line(RedisSock *redis_sock, REDIS_REPLY_TYPE reply_type, zval
1466
1466
}
1467
1467
1468
1468
PHPAPI int
1469
- redis_read_variant_bulk (RedisSock * redis_sock , int size , zval * * z_ret ) {
1469
+ redis_read_variant_bulk (RedisSock * redis_sock , int size , zval * * z_ret TSRMLS_DC ) {
1470
1470
// Attempt to read the bulk reply
1471
- char * bulk_resp = redis_sock_read_bulk_reply (redis_sock , size );
1471
+ char * bulk_resp = redis_sock_read_bulk_reply (redis_sock , size TSRMLS_CC );
1472
1472
1473
1473
// Set our reply to FALSE on failure, and the string on success
1474
1474
if (bulk_resp == NULL ) {
@@ -1481,15 +1481,15 @@ redis_read_variant_bulk(RedisSock *redis_sock, int size, zval **z_ret) {
1481
1481
}
1482
1482
1483
1483
PHPAPI int
1484
- redis_read_multibulk_recursive (RedisSock * redis_sock , int elements , zval * * z_ret ) {
1484
+ redis_read_multibulk_recursive (RedisSock * redis_sock , int elements , zval * * z_ret TSRMLS_DC ) {
1485
1485
int reply_info ;
1486
1486
REDIS_REPLY_TYPE reply_type ;
1487
1487
zval * z_subelem ;
1488
1488
1489
1489
// Iterate while we have elements
1490
1490
while (elements > 0 ) {
1491
1491
// Attempt to read our reply type
1492
- if (redis_read_reply_type (redis_sock , & reply_type , & reply_info ) < 0 ) {
1492
+ if (redis_read_reply_type (redis_sock , & reply_type , & reply_info TSRMLS_CC ) < 0 ) {
1493
1493
zend_throw_exception_ex (redis_exception_ce , 0 TSRMLS_CC , "protocol error, couldn't parse MULTI-BULK response\n" , reply_type );
1494
1494
return -1 ;
1495
1495
}
@@ -1499,7 +1499,7 @@ redis_read_multibulk_recursive(RedisSock *redis_sock, int elements, zval **z_ret
1499
1499
case TYPE_ERR :
1500
1500
case TYPE_LINE :
1501
1501
ALLOC_INIT_ZVAL (z_subelem );
1502
- redis_read_variant_line (redis_sock , reply_type , & z_subelem );
1502
+ redis_read_variant_line (redis_sock , reply_type , & z_subelem TSRMLS_CC );
1503
1503
add_next_index_zval (* z_ret , z_subelem );
1504
1504
break ;
1505
1505
case TYPE_INT :
@@ -1509,15 +1509,15 @@ redis_read_multibulk_recursive(RedisSock *redis_sock, int elements, zval **z_ret
1509
1509
case TYPE_BULK :
1510
1510
// Init a zval for our bulk response, read and add it
1511
1511
ALLOC_INIT_ZVAL (z_subelem );
1512
- redis_read_variant_bulk (redis_sock , reply_info , & z_subelem );
1512
+ redis_read_variant_bulk (redis_sock , reply_info , & z_subelem TSRMLS_CC );
1513
1513
add_next_index_zval (* z_ret , z_subelem );
1514
1514
break ;
1515
1515
case TYPE_MULTIBULK :
1516
1516
// Construct an array for our sub element, and add it, and recurse
1517
1517
ALLOC_INIT_ZVAL (z_subelem );
1518
1518
array_init (z_subelem );
1519
1519
add_next_index_zval (* z_ret , z_subelem );
1520
- redis_read_multibulk_recursive (redis_sock , reply_info , & z_subelem );
1520
+ redis_read_multibulk_recursive (redis_sock , reply_info , & z_subelem TSRMLS_CC );
1521
1521
break ;
1522
1522
}
1523
1523
@@ -1537,7 +1537,7 @@ redis_read_variant_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zv
1537
1537
zval * z_ret ;
1538
1538
1539
1539
// Attempt to read our header
1540
- if (redis_read_reply_type (redis_sock , & reply_type , & reply_info ) < 0 ) {
1540
+ if (redis_read_reply_type (redis_sock , & reply_type , & reply_info TSRMLS_CC ) < 0 ) {
1541
1541
return -1 ;
1542
1542
}
1543
1543
@@ -1548,21 +1548,21 @@ redis_read_variant_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zv
1548
1548
switch (reply_type ) {
1549
1549
case TYPE_ERR :
1550
1550
case TYPE_LINE :
1551
- redis_read_variant_line (redis_sock , reply_type , & z_ret );
1551
+ redis_read_variant_line (redis_sock , reply_type , & z_ret TSRMLS_CC );
1552
1552
break ;
1553
1553
case TYPE_INT :
1554
1554
ZVAL_LONG (z_ret , reply_info );
1555
1555
break ;
1556
1556
case TYPE_BULK :
1557
- redis_read_variant_bulk (redis_sock , reply_info , & z_ret );
1557
+ redis_read_variant_bulk (redis_sock , reply_info , & z_ret TSRMLS_CC );
1558
1558
break ;
1559
1559
case TYPE_MULTIBULK :
1560
1560
// Initialize an array for our multi-bulk response
1561
1561
array_init (z_ret );
1562
1562
1563
1563
// If we've got more than zero elements, parse our multi bulk respoinse recursively
1564
1564
if (reply_info > -1 ) {
1565
- redis_read_multibulk_recursive (redis_sock , reply_info , & z_ret );
1565
+ redis_read_multibulk_recursive (redis_sock , reply_info , & z_ret TSRMLS_CC );
1566
1566
}
1567
1567
break ;
1568
1568
default :
0 commit comments