mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-02 13:23:44 +00:00
lib: logic and macro cleanup in frr_zmq shim
Fix a couple of logic/macro issues in the frr_zmq shim module. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
1dffe35773
commit
e08165def1
@ -310,7 +310,7 @@ void frrzmq_thread_cancel(struct frrzmq_cb **cb, struct cb_core *core)
|
||||
thread_cancel(&core->thread);
|
||||
|
||||
if ((*cb)->read.cancelled && !(*cb)->read.thread
|
||||
&& (*cb)->write.cancelled && (*cb)->write.thread)
|
||||
&& (*cb)->write.cancelled && !(*cb)->write.thread)
|
||||
XFREE(MTYPE_ZEROMQ_CB, *cb);
|
||||
}
|
||||
|
||||
@ -330,12 +330,16 @@ void frrzmq_check_events(struct frrzmq_cb **cbp, struct cb_core *core,
|
||||
len = sizeof(events);
|
||||
if (zmq_getsockopt(cb->zmqsock, ZMQ_EVENTS, &events, &len))
|
||||
return;
|
||||
if (events & event && core->thread && !core->cancelled) {
|
||||
if ((events & event) && core->thread && !core->cancelled) {
|
||||
struct thread_master *tm = core->thread->master;
|
||||
|
||||
thread_cancel(&core->thread);
|
||||
|
||||
thread_add_event(tm, (event == ZMQ_POLLIN ? frrzmq_read_msg
|
||||
: frrzmq_write_msg),
|
||||
cbp, cb->fd, &core->thread);
|
||||
if (event == ZMQ_POLLIN)
|
||||
thread_add_event(tm, frrzmq_read_msg,
|
||||
cbp, cb->fd, &core->thread);
|
||||
else
|
||||
thread_add_event(tm, frrzmq_write_msg,
|
||||
cbp, cb->fd, &core->thread);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user