From 794fd7ece9e36506af0e15c9afc59c90a4bec26c Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Fri, 11 Nov 2022 16:16:17 +0800 Subject: [PATCH] Revert "fix: set connect socket to unblocking call with timeout" This reverts commit 14a57d9b5f2c99f11b36c8b0bc2271f1259e5fef. --- deps/jemalloc | 2 +- src/connector/go | 2 +- src/connector/hivemq-tdengine-extension | 2 +- src/kit/taos-tools | 2 +- src/plugins/taosadapter | 2 +- src/util/src/tsocket.c | 38 ------------------------- 6 files changed, 5 insertions(+), 43 deletions(-) diff --git a/deps/jemalloc b/deps/jemalloc index 54eaed1d8b..ea6b3e973b 160000 --- a/deps/jemalloc +++ b/deps/jemalloc @@ -1 +1 @@ -Subproject commit 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c +Subproject commit ea6b3e973b477b8061e0076bb257dbd7f3faa756 diff --git a/src/connector/go b/src/connector/go index 5afdb16902..7da3cc9e4a 160000 --- a/src/connector/go +++ b/src/connector/go @@ -1 +1 @@ -Subproject commit 5afdb16902d507064deb79a5c0b87d7c9ef6ff3d +Subproject commit 7da3cc9e4ad1030c2eec250b869a8fa215b4a4b4 diff --git a/src/connector/hivemq-tdengine-extension b/src/connector/hivemq-tdengine-extension index af97c27502..82fae157e2 160000 --- a/src/connector/hivemq-tdengine-extension +++ b/src/connector/hivemq-tdengine-extension @@ -1 +1 @@ -Subproject commit af97c27502269351dc9b5119c882720788f69687 +Subproject commit 82fae157e23f0fb1b05d9e4664c842bc5c8211b8 diff --git a/src/kit/taos-tools b/src/kit/taos-tools index a80b1a7c6a..23e2b73fb2 160000 --- a/src/kit/taos-tools +++ b/src/kit/taos-tools @@ -1 +1 @@ -Subproject commit a80b1a7c6a741502988a0930d40fa82bddd39346 +Subproject commit 23e2b73fb2fba1a718f31c95513dbabeed21220a diff --git a/src/plugins/taosadapter b/src/plugins/taosadapter index ac79ade213..1794a8019c 160000 --- a/src/plugins/taosadapter +++ b/src/plugins/taosadapter @@ -1 +1 @@ -Subproject commit ac79ade213e8efd2c699560625ca0eaee116cef1 +Subproject commit 1794a8019c1fa3e601e2c89b64582c8fdc59a27f diff --git a/src/util/src/tsocket.c b/src/util/src/tsocket.c index 3bfa309387..ac8b975fce 100644 --- a/src/util/src/tsocket.c +++ b/src/util/src/tsocket.c @@ -386,44 +386,6 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie } } taosSetNonblocking(sockFd, 0); -#elif _TD_WINDOWS - taosSetNonblocking(sockFd, 1); - - ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr)); - if (ret == -1) { - if (errno == EHOSTUNREACH) { - uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno)); - taosCloseSocket(sockFd); - return -1; - } else if (errno == EINPROGRESS || errno == EAGAIN || errno == EWOULDBLOCK) { - timeval timeout; - fd_set set; - - timeout.tv_sec = 0; - timeout.tv_usec = tsTcpConnTimeout * 1000; - FD_ZERO(&set); - FD_SET(sockFd, &set); - - if (select(sockFd + 1, NULL, &set, NULL, &timeout) <= 0) { - uError("failed to connect socket, ip:0x%x, port:%hu(poll error/conn timeout)", destIp, destPort); - taosCloseSocket(sockFd); // - return -1; - } - - int optVal = -1, optLen = sizeof(int); - if ((0 != taosGetSockOpt(sockFd, SOL_SOCKET, SO_ERROR, &optVal, &optLen)) || (optVal != 0)) { - uError("failed to connect socket, ip:0x%x, port:%hu(connect host error)", destIp, destPort); - taosCloseSocket(sockFd); // - return -1; - } - ret = 0; - } else { - uError("failed to connect socket, ip:0x%x, port:%hu(target host cannot be reached)", destIp, destPort); - taosCloseSocket(sockFd); // - return -1; - } - } - taosSetNonblocking(sockFd, 0); #else ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr)); #endif -- GitLab