Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
4830786c
Commit
4830786c
authored
Apr 10, 2019
by
Mark Nunberg
Browse files
ensure that blocking timeout is set
parent
ca153fa4
Changes
1
Hide whitespace changes
Inline
Side-by-side
hiredis.c
View file @
4830786c
...
...
@@ -593,6 +593,7 @@ static redisContext *redisContextInit(const redisOptions *options) {
c
->
obuf
=
sdsempty
();
c
->
reader
=
redisReaderCreate
();
c
->
fd
=
REDIS_INVALID_FD
;
if
(
c
->
obuf
==
NULL
||
c
->
reader
==
NULL
)
{
redisFree
(
c
);
...
...
@@ -683,6 +684,9 @@ redisContext *redisConnectWithOptions(const redisOptions *options) {
// Unknown type - FIXME - FREE
return
NULL
;
}
if
(
options
->
timeout
!=
NULL
&&
(
c
->
flags
&
REDIS_BLOCK
)
&&
c
->
fd
!=
REDIS_INVALID_FD
)
{
redisContextSetTimeout
(
c
,
*
options
->
timeout
);
}
return
c
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment