提交 d3329e48 编写于 作者: S slguan

Fix the issue #99, when the http request is broken, the query does not end normally

上级 d63f0e7f
......@@ -110,6 +110,7 @@ extern int tsMgmtEqualVnodeNum;
extern int tsEnableHttpModule;
extern int tsEnableMonitorModule;
extern int tsRestRowLimit;
extern int tsTimePrecision;
extern int tsMinSlidingTime;
......
......@@ -148,9 +148,23 @@ bool restBuildSqlJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
httpJsonToken(jsonBuf, JsonArrEnd);
}
httpTrace("context:%p, fd:%d, ip:%s, user:%s, total rows:%lld retrieved", pContext, pContext->fd, pContext->ipstr,
pContext->user, cmd->numOfRows);
return true;
if (cmd->numOfRows >= tsRestRowLimit) {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, retrieve rows:%lld larger than limit:%d, abort retrieve", pContext,
pContext->fd, pContext->ipstr, pContext->user, cmd->numOfRows, tsRestRowLimit);
return false;
}
else {
if (pContext->fd <= 0) {
httpError("context:%p, fd:%d, ip:%s, user:%s, connection is closed, abort retrieve", pContext, pContext->fd,
pContext->ipstr, pContext->user);
return false;
}
else {
httpTrace("context:%p, fd:%d, ip:%s, user:%s, total rows:%lld retrieved", pContext, pContext->fd, pContext->ipstr,
pContext->user, cmd->numOfRows);
return true;
}
}
}
bool restBuildSqlTimeJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result, int numOfRows) {
......
......@@ -98,6 +98,7 @@ int tsMaxVnodeConnections = 10000;
int tsEnableHttpModule = 1;
int tsEnableMonitorModule = 1;
int tsRestRowLimit = 10240;
int tsTimePrecision = TSDB_TIME_PRECISION_MILLI; // time precision, millisecond by default
int tsMinSlidingTime = 10; // 10 ms for sliding time, the value will changed in
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册