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
d9e0299f
Commit
d9e0299f
authored
Feb 19, 2019
by
valentino
Committed by
Mark Nunberg
Feb 20, 2019
Browse files
fix redisLibeventEvents init
parent
271f3395
Changes
1
Hide whitespace changes
Inline
Side-by-side
adapters/libevent.h
View file @
d9e0299f
...
...
@@ -39,7 +39,7 @@
typedef
struct
redisLibeventEvents
{
redisAsyncContext
*
context
;
struct
event
*
ev
,
*
tmr
;
struct
event
*
ev
;
struct
event_base
*
base
;
struct
timeval
tv
;
short
flags
;
...
...
@@ -152,7 +152,7 @@ static int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) {
return
REDIS_ERR
;
/* Create container for context and r/w events */
e
=
(
redisLibeventEvents
*
)
m
alloc
(
sizeof
(
*
e
));
e
=
(
redisLibeventEvents
*
)
c
alloc
(
1
,
sizeof
(
*
e
));
e
->
context
=
ac
;
/* Register functions to start/stop listening for events */
...
...
@@ -166,10 +166,7 @@ static int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) {
/* Initialize and install read/write events */
e
->
ev
=
event_new
(
base
,
c
->
fd
,
EV_READ
|
EV_WRITE
,
redisLibeventHandler
,
e
);
e
->
flags
=
0
;
e
->
base
=
base
;
e
->
tv
.
tv_sec
=
0
;
e
->
tv
.
tv_usec
=
0
;
return
REDIS_OK
;
}
#endif
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