diff options
author | Marc de Jonge <marcdejonge@gmail.com> | 2018-10-08 08:57:51 +0300 |
---|---|---|
committer | Pavlo Yatsukhnenko <yatsukhnenko@users.noreply.github.com> | 2018-10-08 08:57:51 +0300 |
commit | cd6ebc6d7f56ef652cb1dbe5e02126e95aa30156 (patch) | |
tree | 1ab6e0994c20f15f35f4fe531291dc06b3d71dd5 /cluster_library.h | |
parent | 1b7fe98ab7a9c5589d1511ff4cdece85058b8877 (diff) |
Reset the socket after a timeout to make sure no wrong data is received (#1417)
* Reset the socket after a timeout to make sure no wrong data is received
* Remove the lazy_connect completely
* Missing TSRMLS_CC
* Remove redundant check if the stream exists
* Add the redis_sock_server_open to the CLUSTER_SEND_PAYLOAD macro
Diffstat (limited to 'cluster_library.h')
-rw-r--r-- | cluster_library.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/cluster_library.h b/cluster_library.h index 01457832..979b228d 100644 --- a/cluster_library.h +++ b/cluster_library.h @@ -51,13 +51,6 @@ ZSTR_LEN(SLOT_SOCK(c,c->redir_slot)->host) != c->redir_host_len || \ memcmp(ZSTR_VAL(SLOT_SOCK(c,c->redir_slot)->host),c->redir_host,c->redir_host_len)) -/* Lazy connect logic */ -#define CLUSTER_LAZY_CONNECT(s) \ - if(s->lazy_connect) { \ - s->lazy_connect = 0; \ - redis_sock_server_open(s TSRMLS_CC); \ - } - /* Clear out our "last error" */ #define CLUSTER_CLEAR_ERROR(c) do { \ if (c->err) { \ @@ -69,7 +62,7 @@ /* Protected sending of data down the wire to a RedisSock->stream */ #define CLUSTER_SEND_PAYLOAD(sock, buf, len) \ - (sock && sock->stream && !redis_check_eof(sock, 1 TSRMLS_CC) && \ + (sock && !redis_sock_server_open(sock TSRMLS_CC) && sock->stream && !redis_check_eof(sock, 1 TSRMLS_CC) && \ php_stream_write(sock->stream, buf, len)==len) /* Macro to read our reply type character */ |