Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
~笨蛋陪你哭
TDengine
提交
faabd6e5
T
TDengine
项目概览
~笨蛋陪你哭
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
faabd6e5
编写于
8月 14, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1057 compile error in vs2019
上级
fbb185a3
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
77 addition
and
18 deletion
+77
-18
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/common/src/ttimezone.c
src/common/src/ttimezone.c
+1
-1
src/kit/taosnetwork/client.c
src/kit/taosnetwork/client.c
+2
-2
src/kit/taosnetwork/server.c
src/kit/taosnetwork/server.c
+3
-3
src/os/inc/osSocket.h
src/os/inc/osSocket.h
+4
-0
src/os/inc/osWindows.h
src/os/inc/osWindows.h
+19
-3
src/os/src/detail/osSocket.c
src/os/src/detail/osSocket.c
+12
-0
src/os/src/detail/osTime.c
src/os/src/detail/osTime.c
+7
-0
src/os/src/windows/w64Socket.c
src/os/src/windows/w64Socket.c
+21
-1
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+3
-3
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+2
-2
src/util/src/tconfig.c
src/util/src/tconfig.c
+1
-1
未找到文件。
src/client/src/TSDBJNIConnector.c
浏览文件 @
faabd6e5
...
...
@@ -583,7 +583,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_consumeImp(JNIEn
return
0l
;
}
return
(
long
)
res
;
return
(
j
long
)
res
;
}
JNIEXPORT
void
JNICALL
Java_com_taosdata_jdbc_TSDBJNIConnector_unsubscribeImp
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
sub
,
...
...
src/client/src/tscSQLParser.c
浏览文件 @
faabd6e5
...
...
@@ -2390,7 +2390,7 @@ bool validateIpAddress(const char* ip, size_t size) {
strncpy
(
tmp
,
ip
,
size
);
in_addr_t
epAddr
=
inet_a
ddr
(
tmp
);
in_addr_t
epAddr
=
taosInetA
ddr
(
tmp
);
return
epAddr
!=
INADDR_NONE
;
}
...
...
src/common/src/ttimezone.c
浏览文件 @
faabd6e5
...
...
@@ -50,7 +50,7 @@ void tsSetTimeZone() {
#endif
#endif
int32_t
tz
=
(
-
timezone
*
MILLISECOND_PER_SECOND
)
/
MILLISECOND_PER_HOUR
;
int32_t
tz
=
(
int32_t
)((
-
timezone
*
MILLISECOND_PER_SECOND
)
/
MILLISECOND_PER_HOUR
)
;
tz
+=
daylight
;
/*
...
...
src/kit/taosnetwork/client.c
浏览文件 @
faabd6e5
...
...
@@ -91,7 +91,7 @@ int checkTcpPort(info_s *info) {
serverAddr
.
sin_family
=
AF_INET
;
serverAddr
.
sin_port
=
htons
(
port
);
serverAddr
.
sin_addr
.
s_addr
=
inet_a
ddr
(
host
);
serverAddr
.
sin_addr
.
s_addr
=
taosInetA
ddr
(
host
);
//printf("=================================\n");
if
(
connect
(
clientSocket
,
(
struct
sockaddr
*
)
&
serverAddr
,
sizeof
(
serverAddr
))
<
0
)
{
...
...
@@ -157,7 +157,7 @@ int checkUdpPort(info_s *info) {
serverAddr
.
sin_family
=
AF_INET
;
serverAddr
.
sin_port
=
htons
(
port
);
serverAddr
.
sin_addr
.
s_addr
=
inet_a
ddr
(
host
);
serverAddr
.
sin_addr
.
s_addr
=
taosInetA
ddr
(
host
);
memset
(
sendbuf
,
0
,
BUFFER_SIZE
);
memset
(
recvbuf
,
0
,
BUFFER_SIZE
);
...
...
src/kit/taosnetwork/server.c
浏览文件 @
faabd6e5
...
...
@@ -128,7 +128,7 @@ static void *bindTcpPort(void *sarg) {
if
(
errno
==
EINTR
)
{
continue
;
}
else
{
printf
(
"recv Client: %s pkg from TCP port: %d fail:%s.
\n
"
,
inet_n
toa
(
clientAddr
.
sin_addr
),
port
,
strerror
(
errno
));
printf
(
"recv Client: %s pkg from TCP port: %d fail:%s.
\n
"
,
taosInetN
toa
(
clientAddr
.
sin_addr
),
port
,
strerror
(
errno
));
close
(
serverSocket
);
return
NULL
;
}
...
...
@@ -139,7 +139,7 @@ static void *bindTcpPort(void *sarg) {
}
}
printf
(
"recv Client: %s pkg from TCP port: %d, pkg len: %d
\n
"
,
inet_n
toa
(
clientAddr
.
sin_addr
),
port
,
iDataNum
);
printf
(
"recv Client: %s pkg from TCP port: %d, pkg len: %d
\n
"
,
taosInetN
toa
(
clientAddr
.
sin_addr
),
port
,
iDataNum
);
if
(
iDataNum
>
0
)
{
send
(
client
,
buffer
,
iDataNum
,
0
);
break
;
...
...
@@ -188,7 +188,7 @@ static void *bindUdpPort(void *sarg) {
continue
;
}
if
(
iDataNum
>
0
)
{
printf
(
"recv Client: %s pkg from UDP port: %d, pkg len: %d
\n
"
,
inet_n
toa
(
clientAddr
.
sin_addr
),
port
,
iDataNum
);
printf
(
"recv Client: %s pkg from UDP port: %d, pkg len: %d
\n
"
,
taosInetN
toa
(
clientAddr
.
sin_addr
),
port
,
iDataNum
);
//printf("Read msg from udp:%s ... %s\n", buffer, buffer+iDataNum-16);
sendto
(
serverSocket
,
buffer
,
iDataNum
,
0
,
(
struct
sockaddr
*
)
&
clientAddr
,
(
int
)
sin_size
);
...
...
src/os/inc/osSocket.h
浏览文件 @
faabd6e5
...
...
@@ -65,6 +65,10 @@ void taosBlockSIGPIPE();
// TAOS_OS_FUNC_SOCKET_SETSOCKETOPT
int
taosSetSockOpt
(
SOCKET
socketfd
,
int
level
,
int
optname
,
void
*
optval
,
int
optlen
);
// TAOS_OS_FUNC_SOCKET_INET
uint32_t
taosInetAddr
(
char
*
ipAddr
);
const
char
*
taosInetNtoa
(
IN_ADDR
ipInt
);
#ifdef __cplusplus
}
#endif
...
...
src/os/inc/osWindows.h
浏览文件 @
faabd6e5
...
...
@@ -164,9 +164,25 @@ int gettimeofday(struct timeval *ptv, void *pTimeZone);
#define MSG_NOSIGNAL 0
#define SO_NO_CHECK 0x1234
#define SOL_TCP 0x1234
#define TCP_KEEPCNT 0x1234
#define TCP_KEEPIDLE 0x1234
#define TCP_KEEPINTVL 0x1234
#ifndef TCP_KEEPCNT
#define TCP_KEEPCNT 0x1234
#endif
#ifndef TCP_KEEPIDLE
#define TCP_KEEPIDLE 0x1234
#endif
#ifndef TCP_KEEPINTVL
#define TCP_KEEPINTVL 0x1234
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1900
#define TAOS_OS_FUNC_SOCKET_INET
#endif
#endif
#define SHUT_RDWR SD_BOTH
#define SHUT_RD SD_RECEIVE
#define SHUT_WR SD_SEND
...
...
src/os/src/detail/osSocket.c
浏览文件 @
faabd6e5
...
...
@@ -57,4 +57,16 @@ int taosSetSockOpt(SOCKET socketfd, int level, int optname, void *optval, int op
return
setsockopt
(
socketfd
,
level
,
optname
,
optval
,
(
socklen_t
)
optlen
);
}
#endif
#ifndef TAOS_OS_FUNC_SOCKET_INET
uint32_t
taosInetAddr
(
char
*
ipAddr
)
{
return
inet_addr
(
ipAddr
);
}
const
char
*
taosInetNtoa
(
IN_ADDR
ipInt
)
{
return
inet_ntoa
(
ipInt
);
}
#endif
\ No newline at end of file
src/os/src/detail/osTime.c
浏览文件 @
faabd6e5
...
...
@@ -61,8 +61,15 @@ int64_t user_mktime64(const unsigned int year0, const unsigned int mon0,
res
=
res
*
24
;
res
=
((
res
+
hour
)
*
60
+
min
)
*
60
+
sec
;
#ifdef _MSC_VER
#if _MSC_VER >= 1900
int64_t
timezone
=
_timezone
;
#endif
#endif
return
(
res
+
timezone
);
}
// ==== mktime() kernel code =================//
static
int64_t
m_deltaUtc
=
0
;
void
deltaToUtcInitOnce
()
{
...
...
src/os/src/windows/w64Socket.c
浏览文件 @
faabd6e5
...
...
@@ -62,4 +62,24 @@ int taosSetSockOpt(SOCKET socketfd, int level, int optname, void *optval, int op
}
return
setsockopt
(
socketfd
,
level
,
optname
,
optval
,
optlen
);
}
\ No newline at end of file
}
#ifdef TAOS_OS_FUNC_SOCKET_INET
uint32_t
taosInetAddr
(
char
*
ipAddr
)
{
uint32_t
value
;
int
ret
=
inet_pton
(
AF_INET
,
ipAddr
,
&
value
);
if
(
ret
<=
0
)
{
return
INADDR_NONE
;
}
else
{
return
value
;
}
}
const
char
*
taosInetNtoa
(
IN_ADDR
ipInt
)
{
// not thread safe, only for debug usage while print log
static
char
tmpDstStr
[
16
];
return
inet_ntop
(
AF_INET
,
&
ipInt
,
tmpDstStr
,
INET6_ADDRSTRLEN
);
}
#endif
\ No newline at end of file
src/plugins/http/src/httpServer.c
浏览文件 @
faabd6e5
...
...
@@ -302,7 +302,7 @@ static void *httpAcceptHttpConnection(void *arg) {
#if 0
if (totalFds > tsHttpCacheSessions * 100) {
httpError("fd:%d, ip:%s:%u, totalFds:%d larger than httpCacheSessions:%d*100, refuse connection", connFd,
inet_n
toa(clientAddr.sin_addr), htons(clientAddr.sin_port), totalFds, tsHttpCacheSessions);
taosInetN
toa(clientAddr.sin_addr), htons(clientAddr.sin_port), totalFds, tsHttpCacheSessions);
taosCloseSocket(connFd);
continue;
}
...
...
@@ -316,14 +316,14 @@ static void *httpAcceptHttpConnection(void *arg) {
pContext
=
httpCreateContext
(
connFd
);
if
(
pContext
==
NULL
)
{
httpError
(
"fd:%d, ip:%s:%u, no enough resource to allocate http context"
,
connFd
,
inet_n
toa
(
clientAddr
.
sin_addr
),
httpError
(
"fd:%d, ip:%s:%u, no enough resource to allocate http context"
,
connFd
,
taosInetN
toa
(
clientAddr
.
sin_addr
),
htons
(
clientAddr
.
sin_port
));
taosCloseSocket
(
connFd
);
continue
;
}
pContext
->
pThread
=
pThread
;
sprintf
(
pContext
->
ipstr
,
"%s:%u"
,
inet_ntoa
(
clientAddr
.
sin_addr
),
htons
(
clientAddr
.
sin_port
));
sprintf
(
pContext
->
ipstr
,
"%s:%u"
,
taosInetAddr
(
clientAddr
.
sin_addr
),
htons
(
clientAddr
.
sin_port
));
struct
epoll_event
event
;
event
.
events
=
EPOLLIN
|
EPOLLPRI
|
EPOLLWAKEUP
|
EPOLLERR
|
EPOLLHUP
|
EPOLLRDHUP
;
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
faabd6e5
...
...
@@ -254,11 +254,11 @@ static void *taosAcceptTcpConnection(void *arg) {
pFdObj
->
ip
=
caddr
.
sin_addr
.
s_addr
;
pFdObj
->
port
=
htons
(
caddr
.
sin_port
);
tDebug
(
"%s new TCP connection from %s:%hu, fd:%d FD:%p numOfFds:%d"
,
pServerObj
->
label
,
inet_n
toa
(
caddr
.
sin_addr
),
pFdObj
->
port
,
connFd
,
pFdObj
,
pThreadObj
->
numOfFds
);
taosInetN
toa
(
caddr
.
sin_addr
),
pFdObj
->
port
,
connFd
,
pFdObj
,
pThreadObj
->
numOfFds
);
}
else
{
taosCloseSocket
(
connFd
);
tError
(
"%s failed to malloc FdObj(%s) for connection from:%s:%hu"
,
pServerObj
->
label
,
strerror
(
errno
),
inet_n
toa
(
caddr
.
sin_addr
),
htons
(
caddr
.
sin_port
));
taosInetN
toa
(
caddr
.
sin_addr
),
htons
(
caddr
.
sin_port
));
}
// pick up next thread for next connection
...
...
src/util/src/tconfig.c
浏览文件 @
faabd6e5
...
...
@@ -133,7 +133,7 @@ static void taosReadDirectoryConfig(SGlobalCfg *cfg, char *input_value) {
}
static
void
taosReadIpStrConfig
(
SGlobalCfg
*
cfg
,
char
*
input_value
)
{
uint32_t
value
=
inet_a
ddr
(
input_value
);
uint32_t
value
=
taosInetA
ddr
(
input_value
);
char
*
option
=
(
char
*
)
cfg
->
ptr
;
if
(
value
==
INADDR_NONE
)
{
uError
(
"config option:%s, input value:%s, is not a valid ip address, use default value:%s"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录