File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2184,7 +2184,7 @@ static int redis_stream_liveness_check(php_stream *stream) {
2184
2184
2185
2185
/* Try to get the underlying socket FD for use with poll/select.
2186
2186
* Returns -1 on failure. */
2187
- static int redis_stream_fd_for_select (php_stream * stream ) {
2187
+ static php_socket_t redis_stream_fd_for_select (php_stream * stream ) {
2188
2188
php_socket_t fd ;
2189
2189
int flags ;
2190
2190
@@ -2266,6 +2266,11 @@ redis_sock_check_liveness(RedisSock *redis_sock)
2266
2266
smart_string cmd = {0 };
2267
2267
size_t len ;
2268
2268
2269
+ /* Short circuit if we detect the stream is "dirty", can't or are
2270
+ configured not to try and fix it */
2271
+ if (redis_stream_detect_dirty (redis_sock -> stream ) != SUCCESS )
2272
+ goto failure ;
2273
+
2269
2274
/* Short circuit if we detect the stream has gone bad or if the user has
2270
2275
* configured persistent connection "YOLO mode". */
2271
2276
if (redis_stream_liveness_check (redis_sock -> stream ) != SUCCESS ) {
@@ -2386,9 +2391,7 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock)
2386
2391
redis_sock -> stream = * (php_stream * * )zend_llist_get_last (& p -> list );
2387
2392
zend_llist_remove_tail (& p -> list );
2388
2393
2389
- if (redis_stream_detect_dirty (redis_sock -> stream ) == SUCCESS &&
2390
- redis_sock_check_liveness (redis_sock ) == SUCCESS )
2391
- {
2394
+ if (redis_sock_check_liveness (redis_sock ) == SUCCESS ) {
2392
2395
return SUCCESS ;
2393
2396
}
2394
2397
You can’t perform that action at this time.
0 commit comments