Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8da1ff02
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8da1ff02
编写于
6月 03, 2020
作者:
陶建辉(Jeff)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix coverity scan bugs
上级
775c5313
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
7 deletion
+21
-7
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+5
-4
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+4
-0
src/rpc/test/rclient.c
src/rpc/test/rclient.c
+2
-1
src/rpc/test/rsclient.c
src/rpc/test/rsclient.c
+2
-1
src/rpc/test/rserver.c
src/rpc/test/rserver.c
+1
-0
src/util/inc/tutil.h
src/util/inc/tutil.h
+5
-0
src/wal/test/waltest.c
src/wal/test/waltest.c
+2
-1
未找到文件。
src/rpc/src/rpcMain.c
浏览文件 @
8da1ff02
...
...
@@ -218,9 +218,9 @@ void *rpcOpen(const SRpcInit *pInit) {
pRpc
->
localPort
=
pInit
->
localPort
;
pRpc
->
afp
=
pInit
->
afp
;
pRpc
->
sessions
=
pInit
->
sessions
+
1
;
if
(
pInit
->
user
)
strcpy
(
pRpc
->
user
,
pInit
->
user
);
if
(
pInit
->
secret
)
strcpy
(
pRpc
->
secret
,
pInit
->
secret
);
if
(
pInit
->
ckey
)
strcpy
(
pRpc
->
ckey
,
pInit
->
ckey
);
if
(
pInit
->
user
)
tstrncpy
(
pRpc
->
user
,
pInit
->
user
,
sizeof
(
pRpc
->
user
)
);
if
(
pInit
->
secret
)
memcpy
(
pRpc
->
secret
,
pInit
->
secret
,
sizeof
(
pRpc
->
secret
)
);
if
(
pInit
->
ckey
)
tstrncpy
(
pRpc
->
ckey
,
pInit
->
ckey
,
sizeof
(
pRpc
->
ckey
)
);
pRpc
->
spi
=
pInit
->
spi
;
pRpc
->
cfp
=
pInit
->
cfp
;
pRpc
->
afp
=
pInit
->
afp
;
...
...
@@ -434,7 +434,8 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
}
void
rpcSendRedirectRsp
(
void
*
thandle
,
const
SRpcIpSet
*
pIpSet
)
{
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
memset
(
&
rpcMsg
,
0
,
sizeof
(
rpcMsg
));
rpcMsg
.
contLen
=
sizeof
(
SRpcIpSet
);
rpcMsg
.
pCont
=
rpcMallocCont
(
rpcMsg
.
contLen
);
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
8da1ff02
...
...
@@ -253,12 +253,14 @@ void *taosInitTcpClient(uint32_t ip, uint16_t port, char *label, int num, void *
if
(
pthread_mutex_init
(
&
(
pThreadObj
->
mutex
),
NULL
)
<
0
)
{
tError
(
"%s failed to init TCP client mutex(%s)"
,
label
,
strerror
(
errno
));
free
(
pThreadObj
);
return
NULL
;
}
pThreadObj
->
pollFd
=
epoll_create
(
10
);
// size does not matter
if
(
pThreadObj
->
pollFd
<
0
)
{
tError
(
"%s failed to create TCP client epoll"
,
label
);
free
(
pThreadObj
);
return
NULL
;
}
...
...
@@ -269,6 +271,8 @@ void *taosInitTcpClient(uint32_t ip, uint16_t port, char *label, int num, void *
int
code
=
pthread_create
(
&
(
pThreadObj
->
thread
),
&
thattr
,
taosProcessTcpData
,
(
void
*
)(
pThreadObj
));
pthread_attr_destroy
(
&
thattr
);
if
(
code
!=
0
)
{
close
(
pThreadObj
->
pollFd
);
free
(
pThreadObj
);
tError
(
"%s failed to create TCP read data thread(%s)"
,
label
,
strerror
(
errno
));
return
NULL
;
}
...
...
src/rpc/test/rclient.c
浏览文件 @
8da1ff02
...
...
@@ -14,6 +14,7 @@
*/
#include "os.h"
#include "tutil.h"
#include "tglobal.h"
#include "rpcLog.h"
#include "trpc.h"
...
...
@@ -105,7 +106,7 @@ int main(int argc, char *argv[]) {
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
ipSet
.
port
[
0
]
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
&&
i
<
argc
-
1
)
{
strcpy
(
ipSet
.
fqdn
[
0
],
argv
[
++
i
]
);
tstrncpy
(
ipSet
.
fqdn
[
0
],
argv
[
++
i
],
sizeof
(
ipSet
.
fqdn
)
);
}
else
if
(
strcmp
(
argv
[
i
],
"-t"
)
==
0
&&
i
<
argc
-
1
)
{
rpcInit
.
numOfThreads
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
&&
i
<
argc
-
1
)
{
...
...
src/rpc/test/rsclient.c
浏览文件 @
8da1ff02
...
...
@@ -15,6 +15,7 @@
#include "os.h"
#include "tutil.h"
#include "tglobal.h"
#include "rpcLog.h"
#include "trpc.h"
...
...
@@ -106,7 +107,7 @@ int main(int argc, char *argv[]) {
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
ipSet
.
port
[
0
]
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
&&
i
<
argc
-
1
)
{
strcpy
(
ipSet
.
fqdn
[
0
],
argv
[
++
i
]
);
tstrncpy
(
ipSet
.
fqdn
[
0
],
argv
[
++
i
],
sizeof
(
ipSet
.
fqdn
)
);
}
else
if
(
strcmp
(
argv
[
i
],
"-t"
)
==
0
&&
i
<
argc
-
1
)
{
rpcInit
.
numOfThreads
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
&&
i
<
argc
-
1
)
{
...
...
src/rpc/test/rserver.c
浏览文件 @
8da1ff02
...
...
@@ -69,6 +69,7 @@ void processShellMsg() {
taosGetQitem
(
qall
,
&
type
,
(
void
**
)
&
pRpcMsg
);
rpcFreeCont
(
pRpcMsg
->
pCont
);
memset
(
&
rpcMsg
,
0
,
sizeof
(
rpcMsg
));
rpcMsg
.
pCont
=
rpcMallocCont
(
msgSize
);
rpcMsg
.
contLen
=
msgSize
;
rpcMsg
.
handle
=
pRpcMsg
->
handle
;
...
...
src/util/inc/tutil.h
浏览文件 @
8da1ff02
...
...
@@ -42,6 +42,11 @@ extern "C" {
} \
}
#define tstrncpy(dst, src, size) do { \
strncpy((dst), (src), (size)); \
(dst)[(size) - 1] = 0; \
} while (0);
#define tclose(x) taosCloseSocket(x)
// Pointer p drift right by b bytes
...
...
src/wal/test/waltest.c
浏览文件 @
8da1ff02
...
...
@@ -15,6 +15,7 @@
//#define _DEFAULT_SOURCE
#include "os.h"
#include "tutil.h"
#include "tglobal.h"
#include "tlog.h"
#include "twal.h"
...
...
@@ -45,7 +46,7 @@ int main(int argc, char *argv[]) {
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
strcpy
(
path
,
argv
[
++
i
]
);
tstrncpy
(
path
,
argv
[
++
i
],
sizeof
(
path
)
);
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
&&
i
<
argc
-
1
)
{
max
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-l"
)
==
0
&&
i
<
argc
-
1
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录