mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-24 06:53:45 +00:00
Refine event handling
This commit is contained in:
+4
-10
@@ -300,16 +300,10 @@ server_recv_cb(EV_P_ ev_io *w, int revents)
|
||||
return;
|
||||
}
|
||||
|
||||
if (r == 0) {
|
||||
if (verbose)
|
||||
LOGI("connected immediately");
|
||||
remote_send_cb(EV_A_ & remote->send_ctx->io, 0);
|
||||
} else {
|
||||
// wait on remote connected event
|
||||
ev_io_stop(EV_A_ & server_recv_ctx->io);
|
||||
ev_io_start(EV_A_ & remote->send_ctx->io);
|
||||
ev_timer_start(EV_A_ & remote->send_ctx->watcher);
|
||||
}
|
||||
// wait on remote connected event
|
||||
ev_io_stop(EV_A_ & server_recv_ctx->io);
|
||||
ev_io_start(EV_A_ & remote->send_ctx->io);
|
||||
ev_timer_start(EV_A_ & remote->send_ctx->watcher);
|
||||
} else {
|
||||
#ifdef TCP_FASTOPEN
|
||||
#ifdef __APPLE__
|
||||
|
||||
Reference in New Issue
Block a user