mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-27 11:13:47 +00:00
Handle runtime fast open check correctly
This commit is contained in:
+4
-1
@@ -404,10 +404,13 @@ server_recv_cb(EV_P_ ev_io *w, int revents)
|
||||
ev_io_start(EV_A_ & remote->send_ctx->io);
|
||||
return;
|
||||
} else {
|
||||
if (errno == ENOTCONN) {
|
||||
if (errno == EOPNOTSUPP || errno == EPROTONOSUPPORT ||
|
||||
errno == ENOPROTOOPT) {
|
||||
LOGE("fast open is not supported on this platform");
|
||||
// just turn it off
|
||||
fast_open = 0;
|
||||
} else {
|
||||
ERROR("fast_open_connect");
|
||||
}
|
||||
close_and_free_remote(EV_A_ remote);
|
||||
close_and_free_server(EV_A_ server);
|
||||
|
||||
+7
-2
@@ -578,8 +578,13 @@ remote_send_cb(EV_P_ ev_io *w, int revents)
|
||||
ev_io_start(EV_A_ & remote_send_ctx->io);
|
||||
ev_timer_start(EV_A_ & remote_send_ctx->watcher);
|
||||
} else {
|
||||
fast_open = 0;
|
||||
LOGE("fast open is not supported on this platform");
|
||||
if (errno == EOPNOTSUPP || errno == EPROTONOSUPPORT ||
|
||||
errno == ENOPROTOOPT) {
|
||||
fast_open = 0;
|
||||
LOGE("fast open is not supported on this platform");
|
||||
} else {
|
||||
ERROR("fast_open_connect");
|
||||
}
|
||||
close_and_free_remote(EV_A_ remote);
|
||||
close_and_free_server(EV_A_ server);
|
||||
}
|
||||
|
||||
+1
-1
@@ -543,7 +543,7 @@ connect_to_remote(EV_P_ struct addrinfo *res,
|
||||
fast_open = 0;
|
||||
LOGE("fast open is not supported on this platform");
|
||||
} else {
|
||||
ERROR("sendto");
|
||||
ERROR("fast_open_connect");
|
||||
}
|
||||
} else {
|
||||
server->buf->idx += s;
|
||||
|
||||
Reference in New Issue
Block a user