Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XKZJ_WCL
TDengine
提交
52cff8b1
T
TDengine
项目概览
XKZJ_WCL
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
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,发现更多精彩内容 >>
提交
52cff8b1
编写于
7月 31, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the issue #240
上级
18f31711
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
7 deletion
+9
-7
src/modules/http/inc/httpHandle.h
src/modules/http/inc/httpHandle.h
+1
-1
src/modules/http/src/httpServer.c
src/modules/http/src/httpServer.c
+8
-6
未找到文件。
src/modules/http/inc/httpHandle.h
浏览文件 @
52cff8b1
...
...
@@ -64,7 +64,7 @@
#define HTTP_PARSE_BODY_CONTINUE 0
#define HTTP_PARSE_BODY_SUCCESS 1
#define HTTP_RETRY_TIMES
10
#define HTTP_RETRY_TIMES
2
#define HTTP_EXPIRED_TIME 60000
struct
HttpContext
;
...
...
src/modules/http/src/httpServer.c
浏览文件 @
52cff8b1
...
...
@@ -96,7 +96,9 @@ void httpFreeContext(HttpServer *pServer, HttpContext *pContext) {
void
httpCleanUpContext
(
HttpThread
*
pThread
,
HttpContext
*
pContext
)
{
// for not keep-alive
taosTmrStopA
(
pContext
->
readTimer
);
if
(
pContext
->
readTimer
!=
NULL
)
{
taosTmrStopA
(
pContext
->
readTimer
);
}
if
(
pContext
->
fd
>=
0
)
{
epoll_ctl
(
pThread
->
pollFd
,
EPOLL_CTL_DEL
,
pContext
->
fd
,
NULL
);
...
...
@@ -109,8 +111,7 @@ void httpCleanUpContext(HttpThread *pThread, HttpContext *pContext) {
pthread_mutex_lock
(
&
pThread
->
threadMutex
);
pThread
->
numOfFds
--
;
httpTrace
(
"context:%p, ip:%s, fd is cleaned up, thread:%s, numOfFds:%d"
,
pContext
,
pContext
->
ipstr
,
pThread
->
label
,
pThread
->
numOfFds
);
httpTrace
(
"context:%p, ip:%s, thread:%s, numOfFds:%d, fd is cleaned up"
,
pContext
,
pContext
->
ipstr
,
pThread
->
label
,
pThread
->
numOfFds
);
if
(
pThread
->
numOfFds
<
0
)
{
httpError
(
"context:%p, ip:%s, thread:%s, number of FDs:%d shall never be negative"
,
pContext
,
pContext
->
ipstr
,
pThread
->
label
,
pThread
->
numOfFds
);
...
...
@@ -160,7 +161,8 @@ bool httpInitContext(HttpContext *pContext) {
memset
(
pParser
,
0
,
sizeof
(
HttpParser
));
pParser
->
pCur
=
pParser
->
pLast
=
pParser
->
buffer
;
httpTrace
(
"context:%p, fd:%d, ip:%s, accessTimes:%d"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
accessTimes
);
httpTrace
(
"context:%p, fd:%d, ip:%s, thread:%s, accessTimes:%d, parsed:%d"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
pThread
->
label
,
pContext
->
accessTimes
,
pContext
->
parsed
);
return
true
;
}
...
...
@@ -345,8 +347,8 @@ bool httpReadData(HttpThread *pThread, HttpContext *pContext) {
taosTmrReset
(
httpCloseContextByServerFromTimer
,
HTTP_EXPIRED_TIME
,
pContext
,
pThread
->
pServer
->
timerHandle
,
&
pContext
->
readTimer
);
return
false
;
}
else
if
(
ret
==
HTTP_PARSE_BODY_SUCCESS
){
httpDump
(
"context:%p, fd:%d, ip:%s, thread:%s, numOfFds:%d,
content
:
\n
%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
pThread
->
label
,
pContext
->
pThread
->
numOfFds
,
pContext
->
parser
->
data
.
pos
);
httpDump
(
"context:%p, fd:%d, ip:%s, thread:%s, numOfFds:%d,
body
:
\n
%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
pContext
->
pThread
->
label
,
pContext
->
pThread
->
numOfFds
,
pContext
->
parser
.
data
.
pos
);
return
true
;
}
else
{
httpError
(
"context:%p, fd:%d, ip:%s, failed to read http body, close connect"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录