Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ad0cdac4
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看板
未验证
提交
ad0cdac4
编写于
3月 17, 2022
作者:
wafwerar
提交者:
GitHub
3月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10791 from taosdata/fix/ZhiqiangWang/TD-13063-prepare-for-win-compilation
[TD-13063]<fix>: prepare for win compilation.
上级
5705b76e
30c10ef8
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
67 addition
and
60 deletion
+67
-60
contrib/CMakeLists.txt
contrib/CMakeLists.txt
+9
-0
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+3
-3
include/os/os.h
include/os/os.h
+8
-6
include/os/osDef.h
include/os/osDef.h
+1
-0
include/os/osFile.h
include/os/osFile.h
+1
-1
include/os/osSocket.h
include/os/osSocket.h
+2
-0
include/os/osSysinfo.h
include/os/osSysinfo.h
+0
-1
include/util/tencode.h
include/util/tencode.h
+1
-1
include/util/tfreelist.h
include/util/tfreelist.h
+6
-4
include/util/types.h
include/util/types.h
+1
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+1
-1
source/common/src/tname.c
source/common/src/tname.c
+1
-1
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+1
-1
source/libs/sync/src/syncUtil.c
source/libs/sync/src/syncUtil.c
+2
-5
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+3
-1
source/libs/tdb/src/db/tdbEnv.c
source/libs/tdb/src/db/tdbEnv.c
+1
-5
source/libs/tdb/src/db/tdbPgCache.c
source/libs/tdb/src/db/tdbPgCache.c
+1
-5
source/libs/tdb/src/inc/tdbPgFile.h
source/libs/tdb/src/inc/tdbPgFile.h
+3
-1
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+4
-4
source/libs/transport/src/transSrv.c
source/libs/transport/src/transSrv.c
+7
-7
source/libs/wal/src/walMeta.c
source/libs/wal/src/walMeta.c
+0
-3
source/os/CMakeLists.txt
source/os/CMakeLists.txt
+4
-3
source/util/src/tcompare.c
source/util/src/tcompare.c
+1
-1
source/util/test/encodeTest.cpp
source/util/test/encodeTest.cpp
+4
-4
source/util/test/freelistTest.cpp
source/util/test/freelistTest.cpp
+2
-1
未找到文件。
contrib/CMakeLists.txt
浏览文件 @
ad0cdac4
...
...
@@ -212,6 +212,11 @@ if(${BUILD_WITH_UV})
MESSAGE
(
"Windows need set no-sign-compare"
)
add_compile_options
(
-Wno-sign-compare
)
endif
()
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Windows"
)
file
(
READ
"libuv/include/uv.h"
CONTENTS
)
string
(
REGEX REPLACE
"/([
\r
]*)
\n
struct uv_tcp_s {"
"/
\\
1
\n
typedef BOOL (PASCAL *LPFN_CONNECTEX) (SOCKET s, const struct sockaddr* name, int namelen, PVOID lpSendBuffer, DWORD dwSendDataLength,LPDWORD lpdwBytesSent, LPOVERLAPPED lpOverlapped);
\\
1
\n
struct uv_tcp_s {"
CONTENTS_NEW
"
${
CONTENTS
}
"
)
file
(
WRITE
"libuv/include/uv.h"
"
${
CONTENTS_NEW
}
"
)
endif
()
add_subdirectory
(
libuv
)
endif
(
${
BUILD_WITH_UV
}
)
...
...
@@ -243,6 +248,10 @@ if(${BUILD_WITH_SQLITE})
endif
(
${
BUILD_WITH_SQLITE
}
)
# pthread
if
(
${
BUILD_PTHREAD
}
)
ADD_DEFINITIONS
(
"-DPTW32_STATIC_LIB"
)
add_subdirectory
(
pthread-win32
)
endif
(
${
BUILD_PTHREAD
}
)
# ================================================================================================
...
...
include/libs/nodes/plannodes.h
浏览文件 @
ad0cdac4
...
...
@@ -69,7 +69,7 @@ typedef struct SProjectLogicNode {
}
SProjectLogicNode
;
typedef
struct
SVnodeModifLogicNode
{
SLogicNode
node
;
;
SLogicNode
node
;
int32_t
msgType
;
SArray
*
pDataBlocks
;
SVgDataBlocks
*
pVgDataBlocks
;
...
...
@@ -124,7 +124,7 @@ typedef struct SSubLogicPlan {
}
SSubLogicPlan
;
typedef
struct
SQueryLogicPlan
{
ENodeType
type
;
;
ENodeType
type
;
int32_t
totalLevel
;
SNodeList
*
pTopSubplans
;
}
SQueryLogicPlan
;
...
...
@@ -252,7 +252,7 @@ typedef struct SSubplan {
}
SSubplan
;
typedef
struct
SQueryPlan
{
ENodeType
type
;
;
ENodeType
type
;
uint64_t
queryId
;
int32_t
numOfSubplans
;
SNodeList
*
pSubplans
;
// Element is SNodeListNode. The execution level of subplan, starting from 0.
...
...
include/os/os.h
浏览文件 @
ad0cdac4
...
...
@@ -25,10 +25,11 @@ extern "C" {
#include <pthread.h>
#include <semaphore.h>
#include <regex.h>
#if !defined(WINDOWS)
#include <unistd.h>
#include <dirent.h>
#include <regex.h>
#include <sched.h>
#include <wordexp.h>
#include <libgen.h>
...
...
@@ -36,6 +37,12 @@ extern "C" {
#include <sys/utsname.h>
#include <sys/param.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <termios.h>
#include <sys/statvfs.h>
#if defined(DARWIN)
#else
...
...
@@ -61,12 +68,7 @@ extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <wchar.h>
#include <termios.h>
#include <wctype.h>
...
...
include/os/osDef.h
浏览文件 @
ad0cdac4
...
...
@@ -56,6 +56,7 @@ extern "C" {
// specific
typedef
int
(
*
__compar_fn_t
)(
const
void
*
,
const
void
*
);
#define ssize_t int
#define _SSIZE_T_
#define bzero(ptr, size) memset((ptr), 0, (size))
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
...
...
include/os/osFile.h
浏览文件 @
ad0cdac4
...
...
@@ -24,7 +24,7 @@ extern "C" {
#if defined(WINDOWS)
typedef
int32_t
FileFd
;
typedef
SOCKET
SocketFd
;
typedef
int32_t
SocketFd
;
#else
typedef
int32_t
FileFd
;
typedef
int32_t
SocketFd
;
...
...
include/os/osSocket.h
浏览文件 @
ad0cdac4
...
...
@@ -25,6 +25,8 @@
#define epoll_create EPOLL_CREATE_FUNC_TAOS_FORBID
#define epoll_ctl EPOLL_CTL_FUNC_TAOS_FORBID
#define epoll_wait EPOLL_WAIT_FUNC_TAOS_FORBID
#define inet_addr INET_ADDR_FUNC_TAOS_FORBID
#define inet_ntoa INET_NTOA_FUNC_TAOS_FORBID
#endif
#if defined(WINDOWS)
...
...
include/os/osSysinfo.h
浏览文件 @
ad0cdac4
...
...
@@ -16,7 +16,6 @@
#ifndef _TD_OS_SYSINFO_H_
#define _TD_OS_SYSINFO_H_
#include <sys/statvfs.h>
#include "os.h"
#ifdef __cplusplus
...
...
include/util/tencode.h
浏览文件 @
ad0cdac4
...
...
@@ -75,7 +75,7 @@ typedef struct {
#define TD_CODER_CURRENT(CODER) ((CODER)->data + (CODER)->pos)
#define TD_CODER_MOVE_POS(CODER, MOVE) ((CODER)->pos += (MOVE))
#define TD_CODER_CHECK_CAPACITY_FAILED(CODER, EXPSIZE) (((CODER)->size - (CODER)->pos) < (EXPSIZE))
#define TCODER_MALLOC(
SIZE, CODER) TFL_MALLOC(
SIZE, &((CODER)->fl))
#define TCODER_MALLOC(
PTR, TYPE, SIZE, CODER) TFL_MALLOC(PTR, TYPE,
SIZE, &((CODER)->fl))
void
tCoderInit
(
SCoder
*
pCoder
,
td_endian_t
endian
,
uint8_t
*
data
,
int32_t
size
,
td_coder_t
type
);
void
tCoderClear
(
SCoder
*
pCoder
);
...
...
include/util/tfreelist.h
浏览文件 @
ad0cdac4
...
...
@@ -29,15 +29,17 @@ struct SFreeListNode {
typedef
TD_SLIST
(
SFreeListNode
)
SFreeList
;
#define TFL_MALLOC(
SIZE, LIST)
\
({
\
#define TFL_MALLOC(
PTR, TYPE, SIZE, LIST)
\
do {
\
void *ptr = malloc((SIZE) + sizeof(struct SFreeListNode)); \
if (ptr) { \
TD_SLIST_PUSH((LIST), (struct SFreeListNode *)ptr); \
ptr = ((struct SFreeListNode *)ptr)->payload; \
(PTR) = (TYPE)(ptr); \
}else{ \
(PTR) = NULL; \
} \
ptr; \
})
}while(0);
#define tFreeListInit(pFL) TD_SLIST_INIT(pFL)
...
...
include/util/types.h
浏览文件 @
ad0cdac4
...
...
@@ -82,7 +82,7 @@ typedef uint16_t VarDataLenT; // maxVarDataLen: 32767
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define varDataLen(v) ((VarDataLenT *)(v))[0]
#define varDataVal(v) ((
void *)((char *)v + VARSTR_HEADER_SIZE)
)
#define varDataVal(v) ((
char *)(v) + VARSTR_HEADER_SIZE
)
typedef
int32_t
VarDataOffsetT
;
...
...
source/common/src/tmsg.c
浏览文件 @
ad0cdac4
...
...
@@ -2467,7 +2467,7 @@ int32_t tEncodeSMqCMCommitOffsetReq(SCoder *encoder, const SMqCMCommitOffsetReq
int32_t
tDecodeSMqCMCommitOffsetReq
(
SCoder
*
decoder
,
SMqCMCommitOffsetReq
*
pReq
)
{
if
(
tStartDecode
(
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
decoder
,
&
pReq
->
num
)
<
0
)
return
-
1
;
pReq
->
offsets
=
TCODER_MALLOC
(
pReq
->
num
*
sizeof
(
SMqOffset
),
decoder
);
TCODER_MALLOC
(
pReq
->
offsets
,
SMqOffset
*
,
pReq
->
num
*
sizeof
(
SMqOffset
),
decoder
);
if
(
pReq
->
offsets
==
NULL
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
pReq
->
num
;
i
++
)
{
tDecodeSMqOffset
(
decoder
,
&
pReq
->
offsets
[
i
]);
...
...
source/common/src/tname.c
浏览文件 @
ad0cdac4
...
...
@@ -217,7 +217,7 @@ int32_t tNameSetDbName(SName* dst, int32_t acct, const char* dbName, size_t name
}
int32_t
tNameSetAcctId
(
SName
*
dst
,
int32_t
acctId
)
{
assert
(
dst
!=
NULL
&&
acct
!=
NULL
);
assert
(
dst
!=
NULL
);
dst
->
acctId
=
acctId
;
return
0
;
}
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
ad0cdac4
...
...
@@ -89,7 +89,7 @@ static SSubLogicPlan* stsCreateScanSubplan(SSplitContext* pCxt, SScanLogicNode*
pSubplan
->
id
.
groupId
=
pCxt
->
groupId
;
pSubplan
->
subplanType
=
SUBPLAN_TYPE_SCAN
;
pSubplan
->
pNode
=
(
SLogicNode
*
)
nodesCloneNode
(
pScan
);
TSWAP
(
pSubplan
->
pVgroupList
,
((
SScanLogicNode
*
)
pSubplan
->
pNode
)
->
pVgroupList
,
SVgroupsInfo
);
TSWAP
(
pSubplan
->
pVgroupList
,
((
SScanLogicNode
*
)
pSubplan
->
pNode
)
->
pVgroupList
,
SVgroupsInfo
*
);
SPLIT_FLAG_SET_MASK
(
pSubplan
->
splitFlag
,
SPLIT_FLAG_STS
);
return
pSubplan
;
}
...
...
source/libs/sync/src/syncUtil.c
浏览文件 @
ad0cdac4
...
...
@@ -14,15 +14,12 @@
*/
#include "syncUtil.h"
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include "syncEnv.h"
// ---- encode / decode
uint64_t
syncUtilAddr2U64
(
const
char
*
host
,
uint16_t
port
)
{
uint64_t
u64
;
uint32_t
hostU32
=
(
uint32_t
)
inet_a
ddr
(
host
);
uint32_t
hostU32
=
(
uint32_t
)
taosInetA
ddr
(
host
);
// assert(hostU32 != (uint32_t)-1);
u64
=
(((
uint64_t
)
hostU32
)
<<
32
)
|
(((
uint32_t
)
port
)
<<
16
);
return
u64
;
...
...
@@ -33,7 +30,7 @@ void syncUtilU642Addr(uint64_t u64, char* host, size_t len, uint16_t* port) {
struct
in_addr
addr
;
addr
.
s_addr
=
hostU32
;
snprintf
(
host
,
len
,
"%s"
,
inet_n
toa
(
addr
));
snprintf
(
host
,
len
,
"%s"
,
taosInetN
toa
(
addr
));
*
port
=
(
uint16_t
)((
u64
&
0x00000000FFFF0000
)
>>
16
);
}
...
...
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
ad0cdac4
...
...
@@ -27,7 +27,8 @@ typedef struct {
}
SBtIdx
;
// Btree page header definition
typedef
struct
__attribute__
((
__packed__
))
{
#pragma pack (push,1)
typedef
struct
{
uint8_t
flag
;
// page flag
int32_t
vlen
;
// value length of current page, TDB_VARIANT_LEN for variant length
uint16_t
nPayloads
;
// number of total payloads
...
...
@@ -36,6 +37,7 @@ typedef struct __attribute__((__packed__)) {
pgoff_t
offPayload
;
// payload offset
pgno_t
rChildPgno
;
// right most child page number
}
SBtPgHdr
;
#pragma pack(pop)
typedef
int
(
*
BtreeCmprFn
)(
const
void
*
,
const
void
*
);
...
...
source/libs/tdb/src/db/tdbEnv.c
浏览文件 @
ad0cdac4
...
...
@@ -30,11 +30,7 @@ struct STDbEnv {
}
pgfht
;
// page file hash table;
};
#define TDB_ENV_PGF_HASH(fileid) \
({ \
uint8_t *tmp = (uint8_t *)(fileid); \
tmp[0] + tmp[1] + tmp[2]; \
})
#define TDB_ENV_PGF_HASH(fileid) (((uint8_t *)(fileid))[0] + ((uint8_t *)(fileid))[1] + ((uint8_t *)(fileid))[2])
static
int
tdbEnvDestroy
(
TENV
*
pEnv
);
...
...
source/libs/tdb/src/db/tdbPgCache.c
浏览文件 @
ad0cdac4
...
...
@@ -106,11 +106,7 @@ int pgCacheClose(SPgCache *pPgCache) {
return
0
;
}
#define PG_CACHE_HASH(fileid, pgno) \
({ \
uint64_t *tmp = (uint64_t *)(fileid); \
(tmp[0] + tmp[1] + tmp[2] + (pgno)); \
})
#define PG_CACHE_HASH(fileid, pgno) (((uint64_t *)(fileid))[0] + ((uint64_t *)(fileid))[1] + ((uint64_t *)(fileid))[2] + (pgno))
SPage
*
pgCacheFetch
(
SPgCache
*
pPgCache
,
pgid_t
pgid
)
{
SPage
*
pPage
;
...
...
source/libs/tdb/src/inc/tdbPgFile.h
浏览文件 @
ad0cdac4
...
...
@@ -20,13 +20,15 @@
extern
"C"
{
#endif
typedef
struct
__attribute__
((
__packed__
))
{
#pragma pack (push,1)
typedef
struct
{
char
hdrInfo
[
16
];
// info string
pgsz_t
szPage
;
// page size of current file
int32_t
cno
;
// commit number counter
pgno_t
freePgno
;
// freelist page number
uint8_t
resv
[
100
];
// reserved space
}
SPgFileHdr
;
#pragma pack(pop)
#define TDB_PG_FILE_HDR_SIZE 128
...
...
source/libs/transport/src/transCli.c
浏览文件 @
ad0cdac4
...
...
@@ -207,8 +207,8 @@ void cliHandleResp(SCliConn* conn) {
}
tDebug
(
"%s cli conn %p %s received from %s:%d, local info: %s:%d, msg size: %d"
,
pTransInst
->
label
,
conn
,
TMSG_INFO
(
pHead
->
msgType
),
inet_n
toa
(
conn
->
addr
.
sin_addr
),
ntohs
(
conn
->
addr
.
sin_port
),
inet_n
toa
(
conn
->
locaddr
.
sin_addr
),
ntohs
(
conn
->
locaddr
.
sin_port
),
transMsg
.
contLen
);
TMSG_INFO
(
pHead
->
msgType
),
taosInetN
toa
(
conn
->
addr
.
sin_addr
),
ntohs
(
conn
->
addr
.
sin_port
),
taosInetN
toa
(
conn
->
locaddr
.
sin_addr
),
ntohs
(
conn
->
locaddr
.
sin_port
),
transMsg
.
contLen
);
conn
->
secured
=
pHead
->
secured
;
...
...
@@ -519,8 +519,8 @@ void cliSend(SCliConn* pConn) {
uv_buf_t
wb
=
uv_buf_init
((
char
*
)
pHead
,
msgLen
);
tDebug
(
"%s cli conn %p %s is send to %s:%d, local info %s:%d"
,
CONN_GET_INST_LABEL
(
pConn
),
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
inet_n
toa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
inet_n
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
TMSG_INFO
(
pHead
->
msgType
),
taosInetN
toa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetN
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
pConn
->
writeReq
.
data
=
pConn
;
uv_write
(
&
pConn
->
writeReq
,
(
uv_stream_t
*
)
pConn
->
stream
,
&
wb
,
1
,
cliSendCb
);
...
...
source/libs/transport/src/transSrv.c
浏览文件 @
ad0cdac4
...
...
@@ -202,7 +202,7 @@ static void uvHandleReq(SSrvConn* pConn) {
STransMsgHead
*
pHead
=
(
STransMsgHead
*
)
p
->
msg
;
if
(
pHead
->
secured
==
1
)
{
STransUserMsg
*
uMsg
=
(
p
->
msg
+
p
->
msgLen
-
sizeof
(
STransUserMsg
));
STransUserMsg
*
uMsg
=
(
STransUserMsg
*
)((
char
*
)
p
->
msg
+
p
->
msgLen
-
sizeof
(
STransUserMsg
));
memcpy
(
pConn
->
user
,
uMsg
->
user
,
tListLen
(
uMsg
->
user
));
memcpy
(
pConn
->
secret
,
uMsg
->
secret
,
tListLen
(
uMsg
->
secret
));
}
...
...
@@ -235,12 +235,12 @@ static void uvHandleReq(SSrvConn* pConn) {
transRefSrvHandle
(
pConn
);
transMsg
.
handle
=
pConn
;
tDebug
(
"server conn %p %s received from %s:%d, local info: %s:%d, msg size: %d"
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
inet_ntoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
inet_n
toa
(
pConn
->
locaddr
.
sin_addr
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetN
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
),
transMsg
.
contLen
);
}
else
{
tDebug
(
"server conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, no resp "
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
inet_n
toa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
inet_n
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
),
transMsg
.
contLen
);
TMSG_INFO
(
transMsg
.
msgType
),
taosInetN
toa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetN
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
),
transMsg
.
contLen
);
}
STrans
*
pTransInst
=
(
STrans
*
)
p
->
shandle
;
...
...
@@ -347,7 +347,7 @@ static void uvPrepareSendData(SSrvMsg* smsg, uv_buf_t* wb) {
// impl later
}
tDebug
(
"server conn %p %s is sent to %s:%d, local info: %s:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
inet_ntoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
inet_n
toa
(
pConn
->
locaddr
.
sin_addr
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetN
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
pHead
->
msgLen
=
htonl
(
len
);
...
...
@@ -374,8 +374,8 @@ static void uvStartSendResp(SSrvMsg* smsg) {
transUnrefSrvHandle
(
pConn
);
if
(
taosArrayGetSize
(
pConn
->
srvMsgs
)
>
0
)
{
tDebug
(
"server conn %p push data to client %s:%d, local info: %s:%d"
,
pConn
,
inet_n
toa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
inet_n
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
tDebug
(
"server conn %p push data to client %s:%d, local info: %s:%d"
,
pConn
,
taosInetN
toa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetN
toa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
taosArrayPush
(
pConn
->
srvMsgs
,
&
smsg
);
return
;
}
...
...
source/libs/wal/src/walMeta.c
浏览文件 @
ad0cdac4
...
...
@@ -19,9 +19,6 @@
#include "tref.h"
#include "walInt.h"
#include <libgen.h>
#include <regex.h>
int64_t
inline
walGetFirstVer
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
firstVer
;
}
int64_t
inline
walGetSnaphostVer
(
SWal
*
pWal
)
{
return
pWal
->
vers
.
snapshotVer
;
}
...
...
source/os/CMakeLists.txt
浏览文件 @
ad0cdac4
...
...
@@ -3,9 +3,10 @@ add_library(os STATIC ${OS_SRC})
target_include_directories
(
os
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/os"
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/include"
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/include/util"
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/contrib/pthread-win32"
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include"
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/util"
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/contrib/pthread-win32"
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/contrib/gnuregex"
)
target_link_libraries
(
os pthread dl rt m
...
...
source/util/src/tcompare.c
浏览文件 @
ad0cdac4
...
...
@@ -427,7 +427,7 @@ int32_t compareWStrPatternMatch(const void *pLeft, const void *pRight) {
wchar_t
*
pattern
=
calloc
(
varDataLen
(
pRight
)
+
1
,
sizeof
(
wchar_t
));
memcpy
(
pattern
,
varDataVal
(
pRight
),
varDataLen
(
pRight
));
int32_t
ret
=
WCSPatternMatch
(
pattern
,
varDataVal
(
pLeft
),
varDataLen
(
pLeft
)
/
TSDB_NCHAR_SIZE
,
&
pInfo
);
int32_t
ret
=
WCSPatternMatch
(
pattern
,
(
const
wchar_t
*
)
varDataVal
(
pLeft
),
varDataLen
(
pLeft
)
/
TSDB_NCHAR_SIZE
,
&
pInfo
);
free
(
pattern
);
return
(
ret
==
TSDB_PATTERN_MATCH
)
?
0
:
1
;
...
...
source/util/test/encodeTest.cpp
浏览文件 @
ad0cdac4
...
...
@@ -230,7 +230,7 @@ static int32_t tSStructA_v1_decode(SCoder *pCoder, SStructA_v1 *pSAV1) {
const
char
*
tstr
;
uint64_t
len
;
if
(
tDecodeCStrAndLen
(
pCoder
,
&
tstr
,
&
len
)
<
0
)
return
-
1
;
pSAV1
->
A_c
=
(
char
*
)
TCODER_MALLOC
(
len
+
1
,
pCoder
);
TCODER_MALLOC
(
pSAV1
->
A_c
,
char
*
,
len
+
1
,
pCoder
);
memcpy
(
pSAV1
->
A_c
,
tstr
,
len
+
1
);
tEndDecode
(
pCoder
);
...
...
@@ -269,7 +269,7 @@ static int32_t tSStructA_v2_decode(SCoder *pCoder, SStructA_v2 *pSAV2) {
const
char
*
tstr
;
uint64_t
len
;
if
(
tDecodeCStrAndLen
(
pCoder
,
&
tstr
,
&
len
)
<
0
)
return
-
1
;
pSAV2
->
A_c
=
(
char
*
)
TCODER_MALLOC
(
len
+
1
,
pCoder
);
TCODER_MALLOC
(
pSAV2
->
A_c
,
char
*
,
len
+
1
,
pCoder
);
memcpy
(
pSAV2
->
A_c
,
tstr
,
len
+
1
);
// ------------------------NEW FIELDS DECODE-------------------------------
...
...
@@ -305,7 +305,7 @@ static int32_t tSFinalReq_v1_encode(SCoder *pCoder, const SFinalReq_v1 *ps1) {
static
int32_t
tSFinalReq_v1_decode
(
SCoder
*
pCoder
,
SFinalReq_v1
*
ps1
)
{
if
(
tStartDecode
(
pCoder
)
<
0
)
return
-
1
;
ps1
->
pA
=
(
SStructA_v1
*
)
TCODER_MALLOC
(
sizeof
(
*
(
ps1
->
pA
)),
pCoder
);
TCODER_MALLOC
(
ps1
->
pA
,
SStructA_v1
*
,
sizeof
(
*
(
ps1
->
pA
)),
pCoder
);
if
(
tSStructA_v1_decode
(
pCoder
,
ps1
->
pA
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pCoder
,
&
ps1
->
v_a
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pCoder
,
&
ps1
->
v_b
)
<
0
)
return
-
1
;
...
...
@@ -339,7 +339,7 @@ static int32_t tSFinalReq_v2_encode(SCoder *pCoder, const SFinalReq_v2 *ps2) {
static
int32_t
tSFinalReq_v2_decode
(
SCoder
*
pCoder
,
SFinalReq_v2
*
ps2
)
{
if
(
tStartDecode
(
pCoder
)
<
0
)
return
-
1
;
ps2
->
pA
=
(
SStructA_v2
*
)
TCODER_MALLOC
(
sizeof
(
*
(
ps2
->
pA
)),
pCoder
);
TCODER_MALLOC
(
ps2
->
pA
,
SStructA_v2
*
,
sizeof
(
*
(
ps2
->
pA
)),
pCoder
);
if
(
tSStructA_v2_decode
(
pCoder
,
ps2
->
pA
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pCoder
,
&
ps2
->
v_a
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pCoder
,
&
ps2
->
v_b
)
<
0
)
return
-
1
;
...
...
source/util/test/freelistTest.cpp
浏览文件 @
ad0cdac4
...
...
@@ -8,7 +8,8 @@ TEST(TD_UTIL_FREELIST_TEST, simple_test) {
tFreeListInit
(
&
fl
);
for
(
size_t
i
=
0
;
i
<
1000
;
i
++
)
{
void
*
ptr
=
TFL_MALLOC
(
1024
,
&
fl
);
void
*
ptr
=
NULL
;
TFL_MALLOC
(
ptr
,
void
*
,
1024
,
&
fl
);
GTEST_ASSERT_NE
(
ptr
,
nullptr
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录