Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
王长生-AnH
TDengine
提交
0015100d
T
TDengine
项目概览
王长生-AnH
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
Star
0
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,发现更多精彩内容 >>
提交
0015100d
编写于
9月 15, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1364
上级
966b618b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
62 deletion
+50
-62
src/common/src/tglobal.c
src/common/src/tglobal.c
+0
-11
src/plugins/http/src/httpRestJson.c
src/plugins/http/src/httpRestJson.c
+12
-16
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+37
-34
src/util/src/tlog.c
src/util/src/tlog.c
+1
-1
未找到文件。
src/common/src/tglobal.c
浏览文件 @
0015100d
...
...
@@ -957,17 +957,6 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
// http configs
cfg
.
option
=
"httpCacheSessions"
;
cfg
.
ptr
=
&
tsHttpCacheSessions
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
minValue
=
1
;
cfg
.
maxValue
=
100000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"httpEnableRecordSql"
;
cfg
.
ptr
=
&
tsHttpEnableRecordSql
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
...
...
src/plugins/http/src/httpRestJson.c
浏览文件 @
0015100d
...
...
@@ -87,15 +87,12 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
JsonBuf
*
jsonBuf
=
httpMallocJsonBuf
(
pContext
);
if
(
jsonBuf
==
NULL
)
return
false
;
cmd
->
numOfRows
+=
numOfRows
;
int32_t
num_fields
=
taos_num_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
for
(
int32_t
k
=
0
;
k
<
numOfRows
;
++
k
)
{
TAOS_ROW
row
=
taos_fetch_row
(
result
);
if
(
row
==
NULL
)
{
cmd
->
numOfRows
--
;
continue
;
}
int32_t
*
length
=
taos_fetch_lengths
(
result
);
...
...
@@ -151,24 +148,23 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
}
// data row array end
httpJsonToken
(
jsonBuf
,
JsonArrEnd
);
}
httpJsonToken
(
jsonBuf
,
JsonArrEnd
);
cmd
->
numOfRows
++
;
if
(
cmd
->
numOfRows
>=
tsRestRowLimit
)
{
httpDebug
(
"context:%p, fd:%d, user:%s, retrieve rows:%d larger than limit:%d, abort retrieve"
,
pContext
,
pContext
->
fd
,
pContext
->
user
,
cmd
->
numOfRows
,
tsRestRowLimit
);
return
false
;
}
else
{
if
(
pContext
->
fd
<=
0
)
{
httpError
(
"context:%p, fd:%d, user:%s, connection is closed, abort retrieve"
,
pContext
,
pContext
->
fd
,
pContext
->
user
);
httpError
(
"context:%p, fd:%d, user:%s, conn closed, abort retrieve"
,
pContext
,
pContext
->
fd
,
pContext
->
user
);
return
false
;
}
if
(
cmd
->
numOfRows
>=
tsRestRowLimit
)
{
httpDebug
(
"context:%p, fd:%d, user:%s, retrieve rows:%d larger than limit:%d, abort retrieve"
,
pContext
,
pContext
->
fd
,
pContext
->
user
,
cmd
->
numOfRows
,
tsRestRowLimit
);
return
false
;
}
else
{
httpDebug
(
"context:%p, fd:%d, user:%s, total rows:%d retrieved"
,
pContext
,
pContext
->
fd
,
pContext
->
user
,
cmd
->
numOfRows
);
return
true
;
}
}
httpDebug
(
"context:%p, fd:%d, user:%s, retrieved row:%d"
,
pContext
,
pContext
->
fd
,
pContext
->
user
,
cmd
->
numOfRows
);
return
true
;
}
bool
restBuildSqlTimestampJson
(
HttpContext
*
pContext
,
HttpSqlCmd
*
cmd
,
TAOS_RES
*
result
,
int32_t
numOfRows
)
{
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
0015100d
...
...
@@ -315,45 +315,48 @@ static bool httpReadData(HttpContext *pContext) {
pContext
->
accessTimes
++
;
pContext
->
lastAccessTime
=
taosGetTimestampSec
();
char
buf
[
HTTP_STEP_SIZE
+
1
]
=
{
0
};
char
buf
[
HTTP_STEP_SIZE
+
1
]
=
{
0
};
int32_t
nread
=
(
int32_t
)
taosReadSocket
(
pContext
->
fd
,
buf
,
HTTP_STEP_SIZE
);
if
(
nread
>
0
)
{
buf
[
nread
]
=
'\0'
;
httpTraceL
(
"context:%p, fd:%d, nread:%d content:%s"
,
pContext
,
pContext
->
fd
,
nread
,
buf
);
int32_t
ok
=
httpParseBuf
(
pParser
,
buf
,
nread
);
if
(
ok
)
{
httpError
(
"context:%p, fd:%d, parse failed, ret:%d code:%d close connect"
,
pContext
,
pContext
->
fd
,
ok
,
pParser
->
parseCode
);
httpSendErrorResp
(
pContext
,
pParser
->
parseCode
);
httpNotifyContextClose
(
pContext
);
return
false
;
}
while
(
1
)
{
int32_t
nread
=
(
int32_t
)
taosReadSocket
(
pContext
->
fd
,
buf
,
HTTP_STEP_SIZE
);
if
(
nread
>
0
)
{
buf
[
nread
]
=
'\0'
;
httpTraceL
(
"context:%p, fd:%d, nread:%d content:%s"
,
pContext
,
pContext
->
fd
,
nread
,
buf
);
int32_t
ok
=
httpParseBuf
(
pParser
,
buf
,
nread
);
if
(
ok
)
{
httpError
(
"context:%p, fd:%d, parse failed, ret:%d code:%d close connect"
,
pContext
,
pContext
->
fd
,
ok
,
pParser
->
parseCode
);
httpSendErrorResp
(
pContext
,
pParser
->
parseCode
);
httpNotifyContextClose
(
pContext
);
return
false
;
}
if
(
pParser
->
parseCode
)
{
httpError
(
"context:%p, fd:%d, parse failed, code:%d close connect"
,
pContext
,
pContext
->
fd
,
pParser
->
parseCode
);
httpSendErrorResp
(
pContext
,
pParser
->
parseCode
);
httpNotifyContextClose
(
pContext
);
return
false
;
}
if
(
pParser
->
parseCode
)
{
httpError
(
"context:%p, fd:%d, parse failed, code:%d close connect"
,
pContext
,
pContext
->
fd
,
pParser
->
parseCode
);
httpSendErrorResp
(
pContext
,
pParser
->
parseCode
);
httpNotifyContextClose
(
pContext
);
return
false
;
}
if
(
!
pParser
->
parsed
)
{
httpTrace
(
"context:%p, fd:%d, read not over yet, len:%d"
,
pContext
,
pContext
->
fd
,
pParser
->
body
.
pos
);
return
false
;
}
else
{
httpDebug
(
"context:%p, fd:%d, totalLen:%d"
,
pContext
,
pContext
->
fd
,
pParser
->
body
.
pos
);
return
true
;
}
}
else
if
(
nread
<
0
)
{
if
(
errno
==
EINTR
||
errno
==
EAGAIN
||
errno
==
EWOULDBLOCK
)
{
httpDebug
(
"context:%p, fd:%d, read from socket error:%d, wait another event"
,
pContext
,
pContext
->
fd
,
errno
);
return
false
;
// later again
if
(
!
pParser
->
parsed
)
{
httpTrace
(
"context:%p, fd:%d, read not finished"
,
pContext
,
pContext
->
fd
);
continue
;
}
else
{
httpDebug
(
"context:%p, fd:%d, bodyLen:%d"
,
pContext
,
pContext
->
fd
,
pParser
->
body
.
pos
);
return
true
;
}
}
else
if
(
nread
<
0
)
{
if
(
errno
==
EINTR
||
errno
==
EAGAIN
||
errno
==
EWOULDBLOCK
)
{
httpDebug
(
"context:%p, fd:%d, read from socket error:%d, wait another event"
,
pContext
,
pContext
->
fd
,
errno
);
return
false
;
// later again
}
else
{
httpError
(
"context:%p, fd:%d, read from socket error:%d, close connect"
,
pContext
,
pContext
->
fd
,
errno
);
return
false
;
}
}
else
{
httpError
(
"context:%p, fd:%d,
read from socket error:%d, close connect"
,
pContext
,
pContext
->
fd
,
errno
);
httpError
(
"context:%p, fd:%d,
nread:%d, wait another event"
,
pContext
,
pContext
->
fd
,
nread
);
return
false
;
}
}
else
{
httpError
(
"context:%p, fd:%d, nread:%d, wait another event"
,
pContext
,
pContext
->
fd
,
nread
);
return
false
;
}
}
src/util/src/tlog.c
浏览文件 @
0015100d
...
...
@@ -433,7 +433,7 @@ void taosPrintLongString(const char *flags, int32_t dflag, const char *format, .
va_list
argpointer
;
char
buffer
[
MAX_LOGLINE_DUMP_BUFFER_SIZE
];
int32_t
len
;
int32_t
len
;
struct
tm
Tm
,
*
ptm
;
struct
timeval
timeSecs
;
time_t
curTime
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录