Merge pull request #18834 from jtattermusch/revert_bsod_1_20_x

Revert "Enable SIO_LOOPBACK_FAST_PATH on Windows" (for v1.20.x)
pull/18846/head^2
Jan Tattermusch 6 years ago committed by GitHub
commit 5ceccb1419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/core/lib/iomgr/tcp_windows.cc

@ -74,28 +74,12 @@ static grpc_error* set_dualstack(SOCKET sock) {
: GRPC_WSA_ERROR(WSAGetLastError(), "setsockopt(IPV6_V6ONLY)"); : GRPC_WSA_ERROR(WSAGetLastError(), "setsockopt(IPV6_V6ONLY)");
} }
static grpc_error* enable_loopback_fast_path(SOCKET sock) {
int status;
uint32_t param = 1;
DWORD ret;
status = WSAIoctl(sock, /*SIO_LOOPBACK_FAST_PATH==*/_WSAIOW(IOC_VENDOR, 16),
&param, sizeof(param), NULL, 0, &ret, 0, 0);
if (status == SOCKET_ERROR) {
status = WSAGetLastError();
}
return status == 0 || status == WSAEOPNOTSUPP
? GRPC_ERROR_NONE
: GRPC_WSA_ERROR(status, "WSAIoctl(SIO_LOOPBACK_FAST_PATH)");
}
grpc_error* grpc_tcp_prepare_socket(SOCKET sock) { grpc_error* grpc_tcp_prepare_socket(SOCKET sock) {
grpc_error* err; grpc_error* err;
err = grpc_tcp_set_non_block(sock); err = grpc_tcp_set_non_block(sock);
if (err != GRPC_ERROR_NONE) return err; if (err != GRPC_ERROR_NONE) return err;
err = set_dualstack(sock); err = set_dualstack(sock);
if (err != GRPC_ERROR_NONE) return err; if (err != GRPC_ERROR_NONE) return err;
err = enable_loopback_fast_path(sock);
if (err != GRPC_ERROR_NONE) return err;
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }

Loading…
Cancel
Save