Browse Source

Handle runtime fast open check correctly

pull/1816/head
Max Lv 7 years ago
parent
commit
0c3cf8beb3
3 changed files with 12 additions and 4 deletions
  1. 5
      src/local.c
  2. 9
      src/redir.c
  3. 2
      src/server.c

5
src/local.c

@ -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);

9
src/redir.c

@ -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);
}

2
src/server.c

@ -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;

Loading…
Cancel
Save