提交 60edeb43 编写于 作者: S slguan

fix the issue #376

上级 8e11a6b8
......@@ -8,7 +8,7 @@ IF (TD_MVN_INSTALLED)
ADD_CUSTOM_COMMAND(OUTPUT ${JDBC_CMD_NAME}
POST_BUILD
COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver*dist.* ${EXECUTABLE_OUTPUT_PATH}/../lib/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-1.0.1-dist.jar ${LIBRARY_OUTPUT_PATH}
COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml
COMMENT "build jdbc driver")
ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME})
......
......@@ -178,6 +178,7 @@ void tsInitGlobalConfig();
#define TSDB_CFG_CTYPE_B_LOG 4 // is a log type configuration
#define TSDB_CFG_CTYPE_B_CLIENT 8 // can be displayed in the client log
#define TSDB_CFG_CTYPE_B_OPTION 16 // can be configured by taos_options function
#define TSDB_CFG_CTYPE_B_NOT_PRINT 32
#define TSDB_CFG_CSTATUS_NONE 0 // not configured
#define TSDB_CFG_CSTATUS_DEFAULT 1 // use system default value
......
......@@ -269,20 +269,6 @@ void httpCleanUpConnect(HttpServer *pServer) {
httpTrace("http server:%s is cleaned up", pServer->label);
}
void httpCloseDeadConnects(HttpThread *pThread) {
int32_t thresholdSec = taosGetTimestampSec() - 3600;
HttpContext *pContext = (HttpContext*)pThread->pHead;
while (pContext != NULL && pContext == pContext->signature) {
HttpContext *pContextNext = pContext->next;
if (pContext->lastAccessTime < thresholdSec) {
httpPrint("context:%p, fd:%d, ip:%s, lastAccessTime:%d smaller then threshold:%d, so close it",
pContext, pContext->fd, pContext->ipstr, pContext->lastAccessTime, thresholdSec);
httpCloseContextByServer(pThread, pContext);
}
pContext = pContextNext;
}
}
// read all the data, then just discard it
void httpReadDirtyData(int fd) {
char data[1024] = {0};
......@@ -486,7 +472,6 @@ void httpAcceptHttpConnection(void *arg) {
struct sockaddr_in clientAddr;
int sockFd;
int threadId = 0;
const int connThreshold = 2 * tsHttpCacheSessions / tsHttpMaxThreads;
HttpThread * pThread;
HttpServer * pServer;
HttpContext * pContext;
......@@ -570,9 +555,6 @@ void httpAcceptHttpConnection(void *arg) {
pContext, connFd, inet_ntoa(clientAddr.sin_addr), htons(clientAddr.sin_port), pThread->label,
pThread->numOfFds);
if (pThread->numOfFds > connThreshold) {
httpCloseDeadConnects(pThread);
}
// pick up next thread for next connection
threadId++;
threadId = threadId % pServer->numOfThreads;
......
......@@ -483,7 +483,7 @@ void tsInitGlobalConfig() {
tsInitConfigOption(cfg++, "defaultUser", tsDefaultUser, TSDB_CFG_VTYPE_STRING,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, 0, 0, TSDB_USER_LEN, TSDB_CFG_UTYPE_NONE);
tsInitConfigOption(cfg++, "defaultPass", tsDefaultPass, TSDB_CFG_VTYPE_STRING,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, 0, 0, TSDB_PASSWORD_LEN, TSDB_CFG_UTYPE_NONE);
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_NOT_PRINT, 0, 0, TSDB_PASSWORD_LEN, TSDB_CFG_UTYPE_NONE);
// locale & charset
tsInitConfigOption(cfg++, "timezone", tsTimezone, TSDB_CFG_VTYPE_STRING,
......@@ -754,6 +754,7 @@ void tsPrintGlobalConfig() {
for (int i = 0; i < tsGlobalConfigNum; ++i) {
SGlobalConfig *cfg = tsGlobalConfig + i;
if (tscEmbedded == 0 && !(cfg->cfgType & TSDB_CFG_CTYPE_B_CLIENT)) continue;
if (cfg->cfgType & TSDB_CFG_CTYPE_B_NOT_PRINT) continue;
int optionLen = (int)strlen(cfg->option);
int blankLen = TSDB_CFG_PRINT_LEN - optionLen;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册