mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-28 03:33:42 +00:00
Make sure ev_io_stop before ev_io_set
This commit is contained in:
+1
-4
@@ -460,12 +460,9 @@ static void
|
||||
resolv_sock_state_cb(void *data, int s, int read, int write)
|
||||
{
|
||||
struct resolv_ctx *ctx = (struct resolv_ctx *)data;
|
||||
int io_active = ev_is_active(&ctx->io);
|
||||
|
||||
if (read || write) {
|
||||
if (io_active && ctx->io.fd != s) {
|
||||
ev_io_stop(default_loop, &ctx->io);
|
||||
}
|
||||
ev_io_stop(default_loop, &ctx->io);
|
||||
ev_io_set(&ctx->io, s, (read ? EV_READ : 0) | (write ? EV_WRITE : 0));
|
||||
ev_io_start(default_loop, &ctx->io);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user