| line |
true |
false |
branch |
|
106
|
0 |
0 |
if (c == 'u' || c == 'U') return (0 == strcasecmp(cmd, "unsubscribe")); |
|
|
0 |
0 |
if (c == 'u' || c == 'U') return (0 == strcasecmp(cmd, "unsubscribe")); |
|
107
|
0 |
0 |
if (c == 'p' || c == 'P') return (0 == strcasecmp(cmd, "punsubscribe")); |
|
|
0 |
0 |
if (c == 'p' || c == 'P') return (0 == strcasecmp(cmd, "punsubscribe")); |
|
108
|
0 |
0 |
if (c == 's' || c == 'S') return (0 == strcasecmp(cmd, "sunsubscribe")); |
|
|
0 |
0 |
if (c == 's' || c == 'S') return (0 == strcasecmp(cmd, "sunsubscribe")); |
|
115
|
0 |
0 |
if (c == 's' || c == 'S') { |
|
|
0 |
0 |
if (c == 's' || c == 'S') { |
|
116
|
0 |
0 |
if (0 == strcasecmp(cmd, "subscribe")) return 1; |
|
117
|
0 |
0 |
if (0 == strcasecmp(cmd, "ssubscribe")) return 1; |
|
118
|
0 |
0 |
if (0 == strcasecmp(cmd, "sunsubscribe")) return 1; |
|
121
|
0 |
0 |
if (c == 'u' || c == 'U') { |
|
|
0 |
0 |
if (c == 'u' || c == 'U') { |
|
124
|
0 |
0 |
if (c == 'p' || c == 'P') { |
|
|
0 |
0 |
if (c == 'p' || c == 'P') { |
|
125
|
0 |
0 |
if (0 == strcasecmp(cmd, "psubscribe")) return 1; |
|
126
|
0 |
0 |
if (0 == strcasecmp(cmd, "punsubscribe")) return 1; |
|
129
|
0 |
0 |
if (c == 'm' || c == 'M') { |
|
|
0 |
0 |
if (c == 'm' || c == 'M') { |
|
142
|
0 |
0 |
if (reply->type != REDIS_REPLY_ARRAY && reply->type != REDIS_REPLY_PUSH) return 0; |
|
|
0 |
0 |
if (reply->type != REDIS_REPLY_ARRAY && reply->type != REDIS_REPLY_PUSH) return 0; |
|
143
|
0 |
0 |
if (reply->elements < 3) return 0; |
|
144
|
0 |
0 |
if (NULL == reply->element[0]) return 0; |
|
145
|
0 |
0 |
if (reply->element[0]->type != REDIS_REPLY_STRING && |
|
146
|
0 |
0 |
reply->element[0]->type != REDIS_REPLY_STATUS) return 0; |
|
149
|
0 |
0 |
if (s[0] == 'u' || s[0] == 'U') return (0 == strcasecmp(s, "unsubscribe")); |
|
|
0 |
0 |
if (s[0] == 'u' || s[0] == 'U') return (0 == strcasecmp(s, "unsubscribe")); |
|
150
|
0 |
0 |
if (s[0] == 'p' || s[0] == 'P') return (0 == strcasecmp(s, "punsubscribe")); |
|
|
0 |
0 |
if (s[0] == 'p' || s[0] == 'P') return (0 == strcasecmp(s, "punsubscribe")); |
|
151
|
0 |
0 |
if (s[0] == 's' || s[0] == 'S') return (0 == strcasecmp(s, "sunsubscribe")); |
|
|
0 |
0 |
if (s[0] == 's' || s[0] == 'S') return (0 == strcasecmp(s, "sunsubscribe")); |
|
156
|
0 |
0 |
if (NULL == self->error_handler) return; |
|
163
|
0 |
0 |
PUSHMARK(SP); |
|
164
|
0 |
0 |
XPUSHs(error); |
|
168
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
169
|
0 |
0 |
warn("EV::Redis: exception in error handler: %s", SvPV_nolen(ERRSV)); |
|
172
|
0 |
0 |
FREETMPS; |
|
177
|
0 |
0 |
if (NULL == self->error_handler) return; |
|
185
|
0 |
0 |
PUSHMARK(SP); |
|
186
|
0 |
0 |
EXTEND(SP, 2); |
|
191
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
192
|
0 |
0 |
warn("EV::Redis: exception in command callback: %s", SvPV_nolen(ERRSV)); |
|
194
|
0 |
0 |
FREETMPS; |
|
202
|
0 |
0 |
if (self->magic == EV_REDIS_FREED && |
|
203
|
0 |
0 |
self->callback_depth == 0 && |
|
204
|
0 |
0 |
self->current_cb == NULL) { |
|
213
|
0 |
6 |
if (NULL != self->host) { Safefree(self->host); self->host = NULL; } |
|
214
|
0 |
6 |
if (NULL != self->path) { Safefree(self->path); self->path = NULL; } |
|
215
|
0 |
6 |
if (NULL != self->source_addr) { Safefree(self->source_addr); self->source_addr = NULL; } |
|
216
|
0 |
6 |
if (NULL != self->connect_timeout) { Safefree(self->connect_timeout); self->connect_timeout = NULL; } |
|
217
|
0 |
6 |
if (NULL != self->command_timeout) { Safefree(self->command_timeout); self->command_timeout = NULL; } |
|
219
|
2 |
4 |
if (NULL != self->ssl_ctx) { redisFreeSSLContext(self->ssl_ctx); self->ssl_ctx = NULL; } |
|
224
|
0 |
6 |
if (self->waiting_timer_active && NULL != self->loop && !PL_dirty) { |
|
|
0 |
0 |
if (self->waiting_timer_active && NULL != self->loop && !PL_dirty) { |
|
|
0 |
0 |
if (self->waiting_timer_active && NULL != self->loop && !PL_dirty) { |
|
231
|
0 |
6 |
if (self->reconnect_timer_active && NULL != self->loop && !PL_dirty) { |
|
|
0 |
0 |
if (self->reconnect_timer_active && NULL != self->loop && !PL_dirty) { |
|
|
0 |
0 |
if (self->reconnect_timer_active && NULL != self->loop && !PL_dirty) { |
|
241
|
0 |
0 |
if (ms < 0) croak("%s must be non-negative", name); |
|
242
|
0 |
0 |
if (ms > MAX_TIMEOUT_MS) croak("%s too large (max %d ms)", name, MAX_TIMEOUT_MS); |
|
246
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms)) { |
|
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms)) { |
|
249
|
0 |
0 |
if (NULL == *tv_ptr) { |
|
256
|
0 |
0 |
if (NULL != *tv_ptr) { |
|
268
|
0 |
6 |
if (NULL != *handler_ptr) { |
|
274
|
6 |
0 |
if (has_handler_arg && NULL != handler && SvOK(handler) && SvROK(handler) && |
|
|
6 |
0 |
if (has_handler_arg && NULL != handler && SvOK(handler) && SvROK(handler) && |
|
|
6 |
0 |
if (has_handler_arg && NULL != handler && SvOK(handler) && SvROK(handler) && |
|
|
6 |
0 |
if (has_handler_arg && NULL != handler && SvOK(handler) && SvROK(handler) && |
|
275
|
6 |
0 |
SvTYPE(SvRV(handler)) == SVt_PVCV) { |
|
281
|
6 |
0 |
: &PL_sv_undef; |
|
290
|
0 |
6 |
if (self->in_cb_cleanup) { |
|
299
|
0 |
6 |
while (!ngx_queue_empty(&self->cb_queue)) { |
|
303
|
0 |
0 |
if (cbt == self->current_cb) { |
|
305
|
0 |
0 |
if (ngx_queue_next(q) == ngx_queue_sentinel(&self->cb_queue)) { |
|
313
|
0 |
0 |
if (!cbt->persist) self->pending_count--; |
|
315
|
0 |
0 |
if (NULL != cbt->cb) { |
|
316
|
0 |
0 |
if (NULL != error_sv) { |
|
329
|
0 |
0 |
for (i = 0; i < wt->argc; i++) { |
|
334
|
0 |
0 |
if (NULL != wt->cb) { |
|
345
|
0 |
6 |
if (self->in_wait_cleanup) { |
|
353
|
0 |
6 |
while (!ngx_queue_empty(&self->wait_queue)) { |
|
359
|
0 |
0 |
if (NULL != error_sv && NULL != wt->cb) { |
|
|
0 |
0 |
if (NULL != error_sv && NULL != wt->cb) { |
|
387
|
0 |
0 |
if (NULL != self->host) { Safefree(self->host); self->host = NULL; } |
|
388
|
0 |
0 |
if (NULL != self->path) { Safefree(self->path); self->path = NULL; } |
|
397
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
403
|
0 |
0 |
if (check_destroyed(self)) return; |
|
409
|
0 |
0 |
if (!self->reconnect) return; |
|
410
|
0 |
0 |
if (self->intentional_disconnect) return; |
|
411
|
0 |
0 |
if (NULL == self->loop) return; |
|
413
|
0 |
0 |
if (self->max_reconnect_attempts > 0 && |
|
414
|
0 |
0 |
self->reconnect_attempts >= self->max_reconnect_attempts) { |
|
448
|
0 |
0 |
while (!ngx_queue_empty(&self->wait_queue)) { |
|
452
|
0 |
0 |
if (now - wt->queued_at >= timeout) { |
|
456
|
0 |
0 |
if (NULL != wt->cb) { |
|
476
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
483
|
0 |
0 |
if (check_destroyed(self)) return; |
|
494
|
0 |
0 |
if (NULL == self->loop) return; |
|
495
|
0 |
0 |
if (self->waiting_timeout_ms <= 0) return; |
|
496
|
0 |
0 |
if (ngx_queue_empty(&self->wait_queue)) return; |
|
504
|
0 |
0 |
if (delay < 0) delay = 0; |
|
516
|
0 |
0 |
if (NULL == self->loop) { |
|
521
|
0 |
0 |
if (NULL != self->ac) { |
|
529
|
0 |
0 |
if (NULL != self->path) { |
|
532
|
0 |
0 |
else if (NULL != self->host) { |
|
541
|
0 |
0 |
if (NULL == self->ac) { |
|
547
|
0 |
0 |
if (REDIS_OK != post_connect_setup(self, "reconnect error")) { |
|
556
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
560
|
0 |
0 |
if (REDIS_OK != status) { |
|
562
|
0 |
0 |
emit_error_str(self, c->errstr[0] ? c->errstr : "connect failed"); |
|
563
|
0 |
0 |
if (!self->reconnect || !self->resume_waiting_on_reconnect |
|
|
0 |
0 |
if (!self->reconnect || !self->resume_waiting_on_reconnect |
|
564
|
0 |
0 |
|| self->intentional_disconnect) { |
|
565
|
0 |
0 |
clear_wait_queue_sv(self, sv_2mortal(newSVpv( |
|
574
|
0 |
0 |
if (NULL != self->connect_handler) { |
|
580
|
0 |
0 |
PUSHMARK(SP); |
|
584
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
585
|
0 |
0 |
warn("EV::Redis: exception in connect handler: %s", SvPV_nolen(ERRSV)); |
|
588
|
0 |
0 |
FREETMPS; |
|
606
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
613
|
0 |
0 |
if (self->ac != NULL && self->ac != c) { |
|
|
0 |
0 |
if (self->ac != NULL && self->ac != c) { |
|
614
|
0 |
0 |
if (self->ac_saved == c) self->ac_saved = NULL; |
|
625
|
0 |
0 |
if (REDIS_OK == status) { |
|
629
|
0 |
0 |
error_sv = sv_2mortal(newSVpv( |
|
631
|
0 |
0 |
emit_error_str(self, c->errstr[0] ? c->errstr : "disconnected"); |
|
632
|
0 |
0 |
if (!was_intentional) { |
|
637
|
0 |
0 |
if (NULL != self->disconnect_handler) { |
|
643
|
0 |
0 |
PUSHMARK(SP); |
|
647
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
648
|
0 |
0 |
warn("EV::Redis: exception in disconnect handler: %s", SvPV_nolen(ERRSV)); |
|
651
|
0 |
0 |
FREETMPS; |
|
659
|
0 |
0 |
if (self->ac != NULL && self->ac != c) { |
|
|
0 |
0 |
if (self->ac != NULL && self->ac != c) { |
|
660
|
0 |
0 |
if (!self->resume_waiting_on_reconnect) { |
|
672
|
0 |
0 |
will_reconnect = should_reconnect && !self->intentional_disconnect && self->reconnect; |
|
|
0 |
0 |
will_reconnect = should_reconnect && !self->intentional_disconnect && self->reconnect; |
|
|
0 |
0 |
will_reconnect = should_reconnect && !self->intentional_disconnect && self->reconnect; |
|
673
|
0 |
0 |
if (!self->resume_waiting_on_reconnect || was_intentional || !will_reconnect) { |
|
|
0 |
0 |
if (!self->resume_waiting_on_reconnect || was_intentional || !will_reconnect) { |
|
|
0 |
0 |
if (!self->resume_waiting_on_reconnect || was_intentional || !will_reconnect) { |
|
678
|
0 |
0 |
if (will_reconnect) { |
|
690
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
|
0 |
0 |
if (NULL == self || self->magic != EV_REDIS_MAGIC) return; |
|
691
|
0 |
0 |
if (NULL == self->push_handler || NULL == reply) return; |
|
|
0 |
0 |
if (NULL == self->push_handler || NULL == reply) return; |
|
701
|
0 |
0 |
PUSHMARK(SP); |
|
702
|
0 |
0 |
XPUSHs(sv_2mortal(EV__redis_decode_reply(reply))); |
|
706
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
707
|
0 |
0 |
warn("EV::Redis: exception in push handler: %s", SvPV_nolen(ERRSV)); |
|
710
|
0 |
0 |
FREETMPS; |
|
719
|
0 |
0 |
if (NULL != self->connect_timeout) { |
|
722
|
0 |
0 |
if (NULL != self->command_timeout) { |
|
725
|
0 |
0 |
if (self->prefer_ipv4) { |
|
728
|
0 |
0 |
else if (self->prefer_ipv6) { |
|
731
|
0 |
0 |
if (self->cloexec) { |
|
734
|
0 |
0 |
if (self->reuseaddr) { |
|
737
|
0 |
0 |
if (NULL != self->source_addr && NULL == self->path) { |
|
|
0 |
0 |
if (NULL != self->source_addr && NULL == self->path) { |
|
749
|
0 |
0 |
if (NULL != self->ssl_ctx) { |
|
750
|
0 |
0 |
if (REDIS_OK != redisInitiateSSLWithContext(&self->ac->c, self->ssl_ctx)) { |
|
751
|
0 |
0 |
SV* err = sv_2mortal(newSVpvf("%s: SSL initiation failed: %s", |
|
761
|
0 |
0 |
if (self->keepalive > 0) { |
|
764
|
0 |
0 |
if (self->tcp_user_timeout > 0) { |
|
768
|
0 |
0 |
if (REDIS_OK != redisLibevAttach(self->loop, self->ac)) { |
|
776
|
0 |
0 |
if (self->priority != 0) { |
|
782
|
0 |
0 |
if (NULL != self->push_handler) { |
|
786
|
0 |
0 |
if (self->ac->err) { |
|
832
|
0 |
0 |
if (depth >= EV_REDIS_MAX_REPLY_DEPTH) { |
|
838
|
0 |
0 |
if (reply->elements > 0) { |
|
840
|
0 |
0 |
for (i = 0; i < reply->elements; i++) { |
|
841
|
0 |
0 |
if (NULL != reply->element[i]) { |
|
873
|
0 |
0 |
if (cbt->skipped) { |
|
874
|
0 |
0 |
if (!cbt->persist || NULL == reply) { |
|
|
0 |
0 |
if (!cbt->persist || NULL == reply) { |
|
877
|
0 |
0 |
if (cbt->persist && NULL == reply && cbt->sub_count > 1) { |
|
|
0 |
0 |
if (cbt->persist && NULL == reply && cbt->sub_count > 1) { |
|
|
0 |
0 |
if (cbt->persist && NULL == reply && cbt->sub_count > 1) { |
|
883
|
0 |
0 |
else if (cbt->persist && reply != NULL && is_unsub_reply((redisReply*)reply)) { |
|
|
0 |
0 |
else if (cbt->persist && reply != NULL && is_unsub_reply((redisReply*)reply)) { |
|
|
0 |
0 |
else if (cbt->persist && reply != NULL && is_unsub_reply((redisReply*)reply)) { |
|
885
|
0 |
0 |
if (cbt->sub_count <= 0) { |
|
900
|
0 |
0 |
if (self == NULL) { |
|
901
|
0 |
0 |
if (NULL != cbt->cb) { |
|
903
|
0 |
0 |
sv_2mortal(newSVpv(c->errstr[0] ? c->errstr : "disconnected", 0))); |
|
907
|
0 |
0 |
if (cbt->persist && reply == NULL && cbt->sub_count > 1) { |
|
|
0 |
0 |
if (cbt->persist && reply == NULL && cbt->sub_count > 1) { |
|
|
0 |
0 |
if (cbt->persist && reply == NULL && cbt->sub_count > 1) { |
|
919
|
0 |
0 |
if (self->magic == EV_REDIS_FREED) { |
|
920
|
0 |
0 |
if (NULL != cbt->cb) { |
|
922
|
0 |
0 |
invoke_callback_error(cbt->cb, sv_2mortal(newSVpv(c->errstr[0] ? c->errstr : "disconnected", 0))); |
|
927
|
0 |
0 |
if (!cbt->persist) { |
|
938
|
0 |
0 |
if (self->magic != EV_REDIS_MAGIC) { |
|
939
|
0 |
0 |
if (NULL != cbt->cb) SvREFCNT_dec(cbt->cb); |
|
947
|
0 |
0 |
if (NULL != cbt->cb) { |
|
948
|
0 |
0 |
if (NULL == reply) { |
|
949
|
0 |
0 |
sv_err = sv_2mortal(newSVpv( |
|
959
|
0 |
0 |
PUSHMARK(SP); |
|
960
|
0 |
0 |
EXTEND(SP, 2); |
|
962
|
0 |
0 |
if (((redisReply*)reply)->type == REDIS_REPLY_ERROR) { |
|
972
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
|
0 |
0 |
if (SvTRUE(ERRSV)) { |
|
973
|
0 |
0 |
warn("EV::Redis: exception in command callback: %s", SvPV_nolen(ERRSV)); |
|
976
|
0 |
0 |
FREETMPS; |
|
991
|
0 |
0 |
if (self->magic == EV_REDIS_FREED) { |
|
992
|
0 |
0 |
if (NULL != cbt->cb) { |
|
996
|
0 |
0 |
if (!cbt->persist) { |
|
1003
|
0 |
0 |
if (cbt->skipped) { |
|
1014
|
0 |
0 |
if (cbt->persist && cbt->sub_count > 1) { |
|
|
0 |
0 |
if (cbt->persist && cbt->sub_count > 1) { |
|
1029
|
0 |
0 |
if (cbt->persist && reply != NULL && is_unsub_reply((redisReply*)reply)) { |
|
|
0 |
0 |
if (cbt->persist && reply != NULL && is_unsub_reply((redisReply*)reply)) { |
|
|
0 |
0 |
if (cbt->persist && reply != NULL && is_unsub_reply((redisReply*)reply)) { |
|
1031
|
0 |
0 |
if (cbt->sub_count <= 0) { |
|
1036
|
0 |
0 |
if (NULL != cbt->cb) SvREFCNT_dec(cbt->cb); |
|
1048
|
0 |
0 |
if (cbt->persist && NULL == reply) { |
|
|
0 |
0 |
if (cbt->persist && NULL == reply) { |
|
1049
|
0 |
0 |
if (cbt->sub_count > 1) { |
|
1054
|
0 |
0 |
if (NULL != cbt->cb) SvREFCNT_dec(cbt->cb); |
|
1062
|
0 |
0 |
if (0 == cbt->persist) { |
|
1071
|
0 |
0 |
if (NULL != cbt->cb) SvREFCNT_dec(cbt->cb); |
|
1075
|
0 |
0 |
if (reply != NULL) { |
|
1095
|
0 |
0 |
if (cbt->persist && is_unsubscribe_command(cmd)) { |
|
|
0 |
0 |
if (cbt->persist && is_unsubscribe_command(cmd)) { |
|
1105
|
0 |
0 |
if (REDIS_OK != r) { |
|
1107
|
0 |
0 |
if (!cbt->persist) self->pending_count--; |
|
1109
|
0 |
0 |
if (NULL != cbt->cb) { |
|
1110
|
0 |
0 |
invoke_callback_error(cbt->cb, sv_2mortal(newSVpv( |
|
|
0 |
0 |
invoke_callback_error(cbt->cb, sv_2mortal(newSVpv( |
|
1115
|
0 |
0 |
} else if (fn == NULL) { |
|
1119
|
0 |
0 |
if (NULL != cbt->cb) SvREFCNT_dec(cbt->cb); |
|
1135
|
0 |
0 |
if (NULL == self->ac || self->intentional_disconnect) return; |
|
|
0 |
0 |
if (NULL == self->ac || self->intentional_disconnect) return; |
|
1136
|
0 |
0 |
if (ngx_queue_empty(&self->wait_queue)) return; |
|
1137
|
0 |
0 |
if (self->max_pending > 0 && self->pending_count >= self->max_pending) return; |
|
|
0 |
0 |
if (self->max_pending > 0 && self->pending_count >= self->max_pending) return; |
|
1149
|
0 |
0 |
cbt->sub_count = wt->persist ? wt->argc - 1 : 0; |
|
1152
|
0 |
0 |
if (!cbt->persist) self->pending_count++; |
|
1166
|
0 |
24 |
I_EV_API("EV::Redis"); |
|
|
24 |
0 |
I_EV_API("EV::Redis"); |
|
|
0 |
24 |
I_EV_API("EV::Redis"); |
|
1206
|
0 |
6 |
if (self->magic != EV_REDIS_MAGIC) { |
|
1207
|
0 |
0 |
if (self->magic == EV_REDIS_FREED) { |
|
1232
|
0 |
6 |
if (PL_dirty) { |
|
1233
|
0 |
0 |
if (NULL != self->ac) { |
|
1240
|
0 |
0 |
q != ngx_queue_sentinel(&self->cb_queue); |
|
1250
|
0 |
0 |
if (NULL != self->ac_saved) { |
|
1256
|
0 |
0 |
while (!ngx_queue_empty(&self->wait_queue)) { |
|
1277
|
0 |
6 |
if (NULL != ac_to_free) { |
|
1282
|
0 |
0 |
if (ac_to_free->c.flags & REDIS_IN_CALLBACK) { |
|
1295
|
0 |
6 |
if (self->ac_saved != NULL) { |
|
1300
|
6 |
0 |
CLEAR_HANDLER(self->error_handler); |
|
1301
|
0 |
6 |
CLEAR_HANDLER(self->connect_handler); |
|
1302
|
0 |
6 |
CLEAR_HANDLER(self->disconnect_handler); |
|
1303
|
0 |
6 |
CLEAR_HANDLER(self->push_handler); |
|
1306
|
6 |
0 |
if (!self->in_wait_cleanup) { |
|
1309
|
6 |
0 |
if (!skip_cb_cleanup && !self->in_cb_cleanup) { |
|
|
6 |
0 |
if (!skip_cb_cleanup && !self->in_cb_cleanup) { |
|
1317
|
6 |
0 |
if (self->current_cb == NULL && self->callback_depth == 0) { |
|
|
6 |
0 |
if (self->current_cb == NULL && self->callback_depth == 0) { |
|
1328
|
0 |
0 |
if (NULL != self->ac) { |
|
1342
|
0 |
0 |
if (NULL == self->ac) { |
|
1355
|
0 |
0 |
if (NULL != self->ac) { |
|
1368
|
0 |
0 |
if (NULL == self->ac) { |
|
1384
|
0 |
0 |
if (NULL == self->ac) { |
|
1389
|
0 |
0 |
if (!ngx_queue_empty(&self->wait_queue)) { |
|
1406
|
0 |
0 |
if (self->ac->c.flags & REDIS_IN_CALLBACK) { |
|
1415
|
0 |
0 |
if (check_destroyed(self)) return; |
|
1422
|
0 |
0 |
RETVAL = (NULL != self->ac) ? 1 : 0; |
|
1442
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms) && NULL != self->ac && NULL != self->command_timeout) { |
|
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms) && NULL != self->ac && NULL != self->command_timeout) { |
|
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms) && NULL != self->ac && NULL != self->command_timeout) { |
|
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms) && NULL != self->ac && NULL != self->command_timeout) { |
|
1482
|
0 |
0 |
if (NULL != self->ac) { |
|
1483
|
0 |
0 |
if (NULL != self->push_handler) { |
|
1506
|
0 |
1 |
if (items < 2) { |
|
1511
|
1 |
0 |
if (SvROK(cb) && SvTYPE(SvRV(cb)) == SVt_PVCV) { |
|
|
1 |
0 |
if (SvROK(cb) && SvTYPE(SvRV(cb)) == SVt_PVCV) { |
|
1519
|
0 |
1 |
if (argc < 1) { |
|
1523
|
1 |
0 |
if (NULL == self->ac) { |
|
1524
|
1 |
0 |
if (!self->reconnect_timer_active) { |
|
1534
|
0 |
0 |
for (i = 0; i < argc; i++) { |
|
1541
|
0 |
0 |
if (NULL == self->ac || |
|
1542
|
0 |
0 |
(self->max_pending > 0 && self->pending_count >= self->max_pending)) { |
|
|
0 |
0 |
(self->max_pending > 0 && self->pending_count >= self->max_pending)) { |
|
1546
|
0 |
0 |
for (i = 0; i < argc; i++) { |
|
1573
|
0 |
0 |
cbt->sub_count = persist ? argc - 1 : 0; |
|
1576
|
0 |
0 |
if (!persist) self->pending_count++; |
|
1595
|
0 |
0 |
if (!enable) { |
|
1604
|
0 |
0 |
RETVAL = self->reconnect; |
|
1613
|
0 |
0 |
RETVAL = self->pending_count; |
|
1622
|
0 |
0 |
RETVAL = self->waiting_count; |
|
1631
|
0 |
0 |
if (NULL != limit && SvOK(limit)) { |
|
|
0 |
0 |
if (NULL != limit && SvOK(limit)) { |
|
1633
|
0 |
0 |
if (val < 0) { |
|
1644
|
0 |
0 |
if (check_destroyed(self)) XSRETURN_IV(0); |
|
1646
|
0 |
0 |
RETVAL = self->max_pending; |
|
1655
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms)) { |
|
|
0 |
0 |
if (NULL != timeout_ms && SvOK(timeout_ms)) { |
|
1671
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1674
|
0 |
0 |
RETVAL = self->resume_waiting_on_reconnect; |
|
1683
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1685
|
0 |
0 |
if (prio < EV_MINPRI) prio = EV_MINPRI; |
|
1686
|
0 |
0 |
if (prio > EV_MAXPRI) prio = EV_MAXPRI; |
|
1688
|
0 |
0 |
if (NULL != self->ac) { |
|
1692
|
0 |
0 |
RETVAL = self->priority; |
|
1701
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1703
|
0 |
0 |
if (interval < 0) croak("keepalive interval must be non-negative"); |
|
1704
|
0 |
0 |
if (interval > MAX_TIMEOUT_MS / 1000) croak("keepalive interval too large"); |
|
1706
|
0 |
0 |
if (NULL != self->ac && interval > 0) { |
|
|
0 |
0 |
if (NULL != self->ac && interval > 0) { |
|
1710
|
0 |
0 |
RETVAL = self->keepalive; |
|
1719
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1721
|
0 |
0 |
if (self->prefer_ipv4) self->prefer_ipv6 = 0; |
|
1723
|
0 |
0 |
RETVAL = self->prefer_ipv4; |
|
1732
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1734
|
0 |
0 |
if (self->prefer_ipv6) self->prefer_ipv4 = 0; |
|
1736
|
0 |
0 |
RETVAL = self->prefer_ipv6; |
|
1745
|
0 |
0 |
if (items > 1) { |
|
1746
|
0 |
0 |
if (NULL != self->source_addr) { |
|
1750
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1754
|
0 |
0 |
if (NULL != self->source_addr) { |
|
1767
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1772
|
0 |
0 |
RETVAL = self->tcp_user_timeout; |
|
1781
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1784
|
0 |
0 |
RETVAL = self->cloexec; |
|
1793
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
|
0 |
0 |
if (NULL != value && SvOK(value)) { |
|
1796
|
0 |
0 |
RETVAL = self->reuseaddr; |
|
1810
|
0 |
0 |
if (self->in_wait_cleanup) { |
|
1839
|
0 |
0 |
if (self->in_cb_cleanup) { |
|
1850
|
0 |
0 |
while (!ngx_queue_empty(&self->cb_queue)) { |
|
1854
|
0 |
0 |
if (cbt == self->current_cb) { |
|
1856
|
0 |
0 |
if (ngx_queue_next(q) == ngx_queue_sentinel(&self->cb_queue)) { |
|
1867
|
0 |
0 |
while (!ngx_queue_empty(&local_queue)) { |
|
1868
|
0 |
0 |
if (self->magic == EV_REDIS_FREED) { |
|
1883
|
0 |
0 |
if (!cbt->persist) self->pending_count--; |
|
1888
|
0 |
0 |
if (NULL != cbt->cb) { |
|
1909
|
0 |
4 |
RETVAL = 1; |
|
1927
|
1 |
3 |
ssl_opts.cacert_filename = (SvOK(cacert)) ? SvPV_nolen(cacert) : NULL; |
|
1928
|
1 |
3 |
ssl_opts.capath = (SvOK(capath)) ? SvPV_nolen(capath) : NULL; |
|
1929
|
1 |
3 |
ssl_opts.cert_filename = (SvOK(cert)) ? SvPV_nolen(cert) : NULL; |
|
1930
|
0 |
4 |
ssl_opts.private_key_filename = (SvOK(key)) ? SvPV_nolen(key) : NULL; |
|
1931
|
0 |
4 |
ssl_opts.server_name = (SvOK(server_name)) ? SvPV_nolen(server_name) : NULL; |
|
1934
|
0 |
4 |
if (NULL != self->ssl_ctx) { |
|
1941
|
2 |
2 |
if (NULL == self->ssl_ctx) { |