From 8c55d4860a4432ed149572aa6f8c5958c24cf90a Mon Sep 17 00:00:00 2001 From: slguan Date: Sat, 16 Nov 2019 16:55:41 +0800 Subject: [PATCH] [TBASE-1164] --- src/os/darwin/src/tdarwin.c | 1 - src/os/linux/src/tlinux.c | 1 - src/rpc/src/ttcpserver.c | 3 ++- src/util/src/tglobalcfg.c | 2 +- src/util/src/tsocket.c | 4 ---- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/os/darwin/src/tdarwin.c b/src/os/darwin/src/tdarwin.c index 71e8a56466..de37c76edd 100644 --- a/src/os/darwin/src/tdarwin.c +++ b/src/os/darwin/src/tdarwin.c @@ -204,7 +204,6 @@ int taosOpenUDServerSocket(char *ip, short port) { char name[128]; pTrace("open ud socket:%s", name); - // if (tsAllowLocalhost) ip = "0.0.0.0"; sprintf(name, "%s.%d", ip, port); bzero((char *)&serverAdd, sizeof(serverAdd)); diff --git a/src/os/linux/src/tlinux.c b/src/os/linux/src/tlinux.c index f78250cb52..6a7225b476 100644 --- a/src/os/linux/src/tlinux.c +++ b/src/os/linux/src/tlinux.c @@ -197,7 +197,6 @@ int taosOpenUDServerSocket(char *ip, short port) { char name[128]; pTrace("open ud socket:%s", name); - // if (tsAllowLocalhost) ip = "0.0.0.0"; sprintf(name, "%s.%d", ip, port); bzero((char *)&serverAdd, sizeof(serverAdd)); diff --git a/src/rpc/src/ttcpserver.c b/src/rpc/src/ttcpserver.c index b6b0e07230..abd4740854 100644 --- a/src/rpc/src/ttcpserver.c +++ b/src/rpc/src/ttcpserver.c @@ -195,8 +195,9 @@ static void taosProcessTcpData(void *param) { void *buffer = malloc(1024); int headLen = taosReadMsg(pFdObj->fd, buffer, sizeof(STaosHeader)); + if (headLen != sizeof(STaosHeader)) { - tError("%s read error, headLen:%d", pThreadObj->label, headLen); + tError("%s read error, headLen:%d, errno:%d", pThreadObj->label, headLen, errno); taosCleanUpFdObj(pFdObj); tfree(buffer); continue; diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 407761cff0..ab26eda348 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -77,7 +77,7 @@ float tsRatioOfQueryThreads = 0.5; char tsPublicIp[TSDB_IPv4ADDR_LEN] = {0}; char tsInternalIp[TSDB_IPv4ADDR_LEN] = {0}; char tsPrivateIp[TSDB_IPv4ADDR_LEN] = {0}; -char tsServerIpStr[TSDB_IPv4ADDR_LEN] = "0.0.0.0"; +char tsServerIpStr[TSDB_IPv4ADDR_LEN] = "127.0.0.1"; short tsNumOfVnodesPerCore = 8; short tsNumOfTotalVnodes = 0; short tsCheckHeaderFile = 0; diff --git a/src/util/src/tsocket.c b/src/util/src/tsocket.c index be352eb7ad..da57cd148a 100644 --- a/src/util/src/tsocket.c +++ b/src/util/src/tsocket.c @@ -280,7 +280,6 @@ int taosOpenUdpSocket(char *ip, short port) { int bufSize = 8192000; pTrace("open udp socket:%s:%d", ip, port); - // if (tsAllowLocalhost) ip = "0.0.0.0"; memset((char *)&localAddr, 0, sizeof(localAddr)); localAddr.sin_family = AF_INET; @@ -345,7 +344,6 @@ int taosOpenTcpClientSocket(char *destIp, short destPort, char *clientIp) { int ret; pTrace("open tcp client socket:%s:%d", destIp, destPort); - // if (tsAllowLocalhost) destIp = "0.0.0.0"; sockFd = (int)socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); @@ -441,7 +439,6 @@ int taosOpenTcpServerSocket(char *ip, short port) { int reuse; pTrace("open tcp server socket:%s:%d", ip, port); - // if (tsAllowLocalhost) ip = "0.0.0.0"; bzero((char *)&serverAdd, sizeof(serverAdd)); serverAdd.sin_family = AF_INET; @@ -483,7 +480,6 @@ int taosOpenRawSocket(char *ip) { struct sockaddr_in rawAdd; pTrace("open udp raw socket:%s", ip); - // if (tsAllowLocalhost) ip = "0.0.0.0"; fd = (int)socket(AF_INET, SOCK_RAW, IPPROTO_UDP); if (fd < 0) {