mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-27 19:23:40 +00:00
Do not override error code of setsockopt
This commit is contained in:
+1
-2
@@ -384,14 +384,13 @@ server_recv_cb(EV_P_ ev_io *w, int revents)
|
||||
if(setsockopt(remote->fd, IPPROTO_TCP, TCP_FASTOPEN,
|
||||
&optval, sizeof(optval)) != 0) {
|
||||
ERROR("setsockopt");
|
||||
err = WSAEOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
// Load ConnectEx function
|
||||
LPFN_CONNECTEX ConnectEx = winsock_getconnectex();
|
||||
if (ConnectEx == NULL) {
|
||||
LOGE("Cannot load ConnectEx() function");
|
||||
err = WSAEOPNOTSUPP;
|
||||
err = WSAENOPROTOOPT;
|
||||
break;
|
||||
}
|
||||
// ConnectEx requires a bound socket
|
||||
|
||||
+1
-2
@@ -530,14 +530,13 @@ connect_to_remote(EV_P_ struct addrinfo *res,
|
||||
if(setsockopt(sockfd, IPPROTO_TCP, TCP_FASTOPEN,
|
||||
&optval, sizeof(optval)) != 0) {
|
||||
ERROR("setsockopt");
|
||||
err = WSAEOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
// Load ConnectEx function
|
||||
LPFN_CONNECTEX ConnectEx = winsock_getconnectex();
|
||||
if (ConnectEx == NULL) {
|
||||
LOGE("Cannot load ConnectEx() function");
|
||||
err = WSAEOPNOTSUPP;
|
||||
err = WSAENOPROTOOPT;
|
||||
break;
|
||||
}
|
||||
// ConnectEx requires a bound socket
|
||||
|
||||
Reference in New Issue
Block a user