mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
bev_async: do not initialize timeouts multiple times
You cannot event_assign() event multiple times, this is UB, and most likely will fail. Fixes: af9b2a7ae0be11c79a909d212b1833a9379e4ba0 ("Initialize async bufferevent timeout CBs unconditionally")
This commit is contained in:
parent
e73875dfe2
commit
2bf673a467
@ -589,7 +589,6 @@ bufferevent_async_set_connected_(struct bufferevent *bev)
|
|||||||
{
|
{
|
||||||
struct bufferevent_async *bev_async = upcast(bev);
|
struct bufferevent_async *bev_async = upcast(bev);
|
||||||
bev_async->ok = 1;
|
bev_async->ok = 1;
|
||||||
bufferevent_init_generic_timeout_cbs_(bev);
|
|
||||||
/* Now's a good time to consider reading/writing */
|
/* Now's a good time to consider reading/writing */
|
||||||
be_async_enable(bev, bev->enabled);
|
be_async_enable(bev, bev->enabled);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user