Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a9899065
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a9899065
编写于
8月 04, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1038 compile for windows client
上级
73e0e84b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
16 addition
and
9 deletion
+16
-9
src/os/inc/osSemphone.h
src/os/inc/osSemphone.h
+1
-0
src/os/inc/osWindows.h
src/os/inc/osWindows.h
+3
-0
src/os/src/detail/osSemphone.c
src/os/src/detail/osSemphone.c
+1
-0
src/rpc/src/rpcCache.c
src/rpc/src/rpcCache.c
+2
-2
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+4
-4
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+2
-2
src/rpc/src/rpcUdp.c
src/rpc/src/rpcUdp.c
+3
-1
未找到文件。
src/os/inc/osSemphone.h
浏览文件 @
a9899065
...
...
@@ -31,6 +31,7 @@ extern "C" {
// TAOS_OS_FUNC_SEMPHONE_PTHREAD
bool
taosCheckPthreadValid
(
pthread_t
thread
);
int64_t
taosGetPthreadId
();
void
taosResetPthread
(
pthread_t
*
thread
);
#ifdef __cplusplus
}
...
...
src/os/inc/osWindows.h
浏览文件 @
a9899065
...
...
@@ -160,6 +160,9 @@ char * strndup(const char *s, size_t n);
#define TCP_KEEPCNT 0x1234
#define TCP_KEEPIDLE 0x1234
#define TCP_KEEPINTVL 0x1234
#define SHUT_RDWR SD_BOTH
#define SHUT_RD SD_RECEIVE
#define SHUT_WR SD_SEND
#define LOCK_EX 1
#define LOCK_NB 2
...
...
src/os/src/detail/osSemphone.c
浏览文件 @
a9899065
...
...
@@ -20,5 +20,6 @@
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
return
thread
!=
0
;
}
int64_t
taosGetPthreadId
()
{
return
(
int64_t
)
pthread_self
();
}
void
taosResetPthread
(
pthread_t
*
thread
)
{
*
thread
=
0
;
}
#endif
\ No newline at end of file
src/rpc/src/rpcCache.c
浏览文件 @
a9899065
...
...
@@ -82,7 +82,7 @@ void *rpcOpenConnCache(int maxSessions, void (*cleanFp)(void *), void *tmrCtrl,
pCache
->
cleanFp
=
cleanFp
;
pCache
->
tmrCtrl
=
tmrCtrl
;
pCache
->
lockedBy
=
calloc
(
sizeof
(
int64_t
),
maxSessions
);
taosTmrReset
(
rpcCleanConnCache
,
pCache
->
keepTimer
*
2
,
pCache
,
pCache
->
tmrCtrl
,
&
pCache
->
pTimer
);
taosTmrReset
(
rpcCleanConnCache
,
(
int32_t
)(
pCache
->
keepTimer
*
2
)
,
pCache
,
pCache
->
tmrCtrl
,
&
pCache
->
pTimer
);
pthread_mutex_init
(
&
pCache
->
mutex
,
NULL
);
...
...
@@ -226,7 +226,7 @@ static void rpcCleanConnCache(void *handle, void *tmrId) {
}
// tTrace("timer, total connections in cache:%d", pCache->total);
taosTmrReset
(
rpcCleanConnCache
,
pCache
->
keepTimer
*
2
,
pCache
,
pCache
->
tmrCtrl
,
&
pCache
->
pTimer
);
taosTmrReset
(
rpcCleanConnCache
,
(
int32_t
)(
pCache
->
keepTimer
*
2
)
,
pCache
,
pCache
->
tmrCtrl
,
&
pCache
->
pTimer
);
}
static
void
rpcRemoveExpiredNodes
(
SConnCache
*
pCache
,
SConnHash
*
pNode
,
int
hash
,
uint64_t
time
)
{
...
...
src/rpc/src/rpcMain.c
浏览文件 @
a9899065
...
...
@@ -33,7 +33,7 @@
#include "rpcHead.h"
#define RPC_MSG_OVERHEAD (sizeof(SRpcReqContext) + sizeof(SRpcHead) + sizeof(SRpcDigest))
#define rpcHeadFromCont(cont) ((SRpcHead *) (cont - sizeof(SRpcHead)))
#define rpcHeadFromCont(cont) ((SRpcHead *) (
(char*)
cont - sizeof(SRpcHead)))
#define rpcContFromHead(msg) (msg + sizeof(SRpcHead))
#define rpcMsgLenFromCont(contLen) (contLen + sizeof(SRpcHead))
#define rpcContLenFromMsg(msgLen) (msgLen - sizeof(SRpcHead))
...
...
@@ -359,7 +359,7 @@ void rpcSendRequest(void *shandle, const SRpcEpSet *pEpSet, SRpcMsg *pMsg) {
SRpcReqContext
*
pContext
;
int
contLen
=
rpcCompressRpcMsg
(
pMsg
->
pCont
,
pMsg
->
contLen
);
pContext
=
(
SRpcReqContext
*
)
(
pMsg
->
pCont
-
sizeof
(
SRpcHead
)
-
sizeof
(
SRpcReqContext
));
pContext
=
(
SRpcReqContext
*
)
(
(
char
*
)
pMsg
->
pCont
-
sizeof
(
SRpcHead
)
-
sizeof
(
SRpcReqContext
));
pContext
->
ahandle
=
pMsg
->
ahandle
;
pContext
->
signature
=
pContext
;
pContext
->
pRpc
=
(
SRpcInfo
*
)
shandle
;
...
...
@@ -492,7 +492,7 @@ int rpcGetConnInfo(void *thandle, SRpcConnInfo *pInfo) {
void
rpcSendRecv
(
void
*
shandle
,
SRpcEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
SRpcMsg
*
pRsp
)
{
SRpcReqContext
*
pContext
;
pContext
=
(
SRpcReqContext
*
)
(
pMsg
->
pCont
-
sizeof
(
SRpcHead
)
-
sizeof
(
SRpcReqContext
));
pContext
=
(
SRpcReqContext
*
)
(
(
char
*
)
pMsg
->
pCont
-
sizeof
(
SRpcHead
)
-
sizeof
(
SRpcReqContext
));
memset
(
pRsp
,
0
,
sizeof
(
SRpcMsg
));
...
...
@@ -654,7 +654,7 @@ static SRpcConn *rpcAllocateClientConn(SRpcInfo *pRpc) {
pConn
->
pRpc
=
pRpc
;
pConn
->
sid
=
sid
;
pConn
->
tranId
=
(
uint16_t
)(
random
()
&
0xFFFF
);
pConn
->
tranId
=
(
uint16_t
)(
taosRand
()
&
0xFFFF
);
pConn
->
ownId
=
htonl
(
pConn
->
sid
);
pConn
->
linkUid
=
(
uint32_t
)((
int64_t
)
pConn
+
(
int64_t
)
getpid
()
+
(
int64_t
)
pConn
->
tranId
);
pConn
->
spi
=
pRpc
->
spi
;
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
a9899065
...
...
@@ -81,7 +81,7 @@ void *taosInitTcpServer(uint32_t ip, uint16_t port, char *label, int numOfThread
}
pServerObj
->
fd
=
-
1
;
pServerObj
->
thread
=
0
;
taosResetPthread
(
&
pServerObj
->
thread
)
;
pServerObj
->
ip
=
ip
;
pServerObj
->
port
=
port
;
tstrncpy
(
pServerObj
->
label
,
label
,
sizeof
(
pServerObj
->
label
));
...
...
@@ -104,7 +104,7 @@ void *taosInitTcpServer(uint32_t ip, uint16_t port, char *label, int numOfThread
pThreadObj
=
pServerObj
->
pThreadObj
;
for
(
int
i
=
0
;
i
<
numOfThreads
;
++
i
)
{
pThreadObj
->
pollFd
=
-
1
;
pThreadObj
->
thread
=
0
;
taosResetPthread
(
&
pThreadObj
->
thread
)
;
pThreadObj
->
processData
=
fp
;
tstrncpy
(
pThreadObj
->
label
,
label
,
sizeof
(
pThreadObj
->
label
));
pThreadObj
->
shandle
=
shandle
;
...
...
src/rpc/src/rpcUdp.c
浏览文件 @
a9899065
...
...
@@ -144,7 +144,9 @@ void taosStopUdpConnection(void *handle) {
for
(
int
i
=
0
;
i
<
pSet
->
threads
;
++
i
)
{
pConn
=
pSet
->
udpConn
+
i
;
if
(
pConn
->
thread
)
pthread_join
(
pConn
->
thread
,
NULL
);
if
(
taosCheckPthreadValid
(
pConn
->
thread
))
{
pthread_join
(
pConn
->
thread
,
NULL
);
}
taosTFree
(
pConn
->
buffer
);
// tTrace("%s UDP thread is closed, index:%d", pConn->label, i);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录