commit
ad54000ab3
|
@ -141,12 +141,12 @@ IF (NOT DEFINED TD_CLUSTER)
|
||||||
SET(RELEASE_FLAGS "-O0")
|
SET(RELEASE_FLAGS "-O0")
|
||||||
IF (NOT TD_ARM)
|
IF (NOT TD_ARM)
|
||||||
IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||||
ELSE ()
|
ELSE ()
|
||||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ELSE ()
|
ELSE ()
|
||||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -Wno-char-subscripts -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ADD_DEFINITIONS(-DLINUX)
|
ADD_DEFINITIONS(-DLINUX)
|
||||||
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
|
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
|
||||||
|
@ -156,7 +156,7 @@ IF (NOT DEFINED TD_CLUSTER)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
SET(DEBUG_FLAGS "-O0 -DDEBUG")
|
SET(DEBUG_FLAGS "-O0 -DDEBUG")
|
||||||
SET(RELEASE_FLAGS "-O0")
|
SET(RELEASE_FLAGS "-O0")
|
||||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -Wno-char-subscripts -fsigned-char -munaligned-access -fpack-struct=8 -latomic -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -fsigned-char -munaligned-access -fpack-struct=8 -latomic -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||||
ADD_DEFINITIONS(-DLINUX)
|
ADD_DEFINITIONS(-DLINUX)
|
||||||
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
|
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
|
||||||
ADD_DEFINITIONS(-DUSE_LIBICONV)
|
ADD_DEFINITIONS(-DUSE_LIBICONV)
|
||||||
|
@ -171,7 +171,7 @@ IF (NOT DEFINED TD_CLUSTER)
|
||||||
ADD_DEFINITIONS(-DPTW32_BUILD)
|
ADD_DEFINITIONS(-DPTW32_BUILD)
|
||||||
ADD_DEFINITIONS(-D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
ADD_DEFINITIONS(-D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
ELSEIF (TD_DARWIN_64)
|
ELSEIF (TD_DARWIN_64)
|
||||||
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-unused-variable -Wno-bitfield-constant-conversion")
|
SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
|
||||||
SET(DEBUG_FLAGS "-O0 -DDEBUG")
|
SET(DEBUG_FLAGS "-O0 -DDEBUG")
|
||||||
SET(RELEASE_FLAGS "-O0")
|
SET(RELEASE_FLAGS "-O0")
|
||||||
ADD_DEFINITIONS(-DDARWIN)
|
ADD_DEFINITIONS(-DDARWIN)
|
||||||
|
|
|
@ -239,7 +239,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
|
||||||
jbyteArray jsql, jlong con) {
|
jbyteArray jsql, jlong con) {
|
||||||
TAOS *tscon = (TAOS *)con;
|
TAOS *tscon = (TAOS *)con;
|
||||||
if (tscon == NULL) {
|
if (tscon == NULL) {
|
||||||
jniError("jobj:%p, connection is closed", jobj);
|
jniError("jobj:%p, connection is already closed", jobj);
|
||||||
return JNI_CONNECTION_NULL;
|
return JNI_CONNECTION_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,6 +252,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
|
||||||
|
|
||||||
char *dst = (char *)calloc(1, sizeof(char) * (len + 1));
|
char *dst = (char *)calloc(1, sizeof(char) * (len + 1));
|
||||||
if (dst == NULL) {
|
if (dst == NULL) {
|
||||||
|
jniError("jobj:%p, conn:%p, can not alloc memory", jobj, tscon);
|
||||||
return JNI_OUT_OF_MEMORY;
|
return JNI_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,6 +261,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
|
||||||
//todo handle error
|
//todo handle error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jniTrace("jobj:%p, conn:%p, sql:%s", jobj, tscon, sql);
|
||||||
|
|
||||||
int code = taos_query(tscon, dst);
|
int code = taos_query(tscon, dst);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
jniError("jobj:%p, conn:%p, code:%d, msg:%s, sql:%s", jobj, tscon, code, taos_errstr(tscon), dst);
|
jniError("jobj:%p, conn:%p, code:%d, msg:%s, sql:%s", jobj, tscon, code, taos_errstr(tscon), dst);
|
||||||
|
@ -271,9 +274,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
|
||||||
|
|
||||||
if (pSql->cmd.command == TSDB_SQL_INSERT) {
|
if (pSql->cmd.command == TSDB_SQL_INSERT) {
|
||||||
affectRows = taos_affected_rows(tscon);
|
affectRows = taos_affected_rows(tscon);
|
||||||
jniTrace("jobj:%p, conn:%p, code:%d, affect rows:%d, sql:%s", jobj, tscon, code, affectRows, dst);
|
jniTrace("jobj:%p, conn:%p, code:%d, affect rows:%d", jobj, tscon, code, affectRows, dst);
|
||||||
} else {
|
} else {
|
||||||
jniTrace("jobj:%p, conn:%p, code:%d, sql:%s", jobj, tscon, code, dst);
|
jniTrace("jobj:%p, conn:%p, code:%d", jobj, tscon, code, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(dst);
|
free(dst);
|
||||||
|
@ -307,7 +310,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getResultSetImp(
|
||||||
|
|
||||||
if (tscIsUpdateQuery(tscon)) {
|
if (tscIsUpdateQuery(tscon)) {
|
||||||
ret = 0; // for update query, no result pointer
|
ret = 0; // for update query, no result pointer
|
||||||
jniTrace("jobj:%p, conn:%p, no result", jobj, tscon);
|
jniTrace("jobj:%p, conn:%p, no resultset", jobj, tscon);
|
||||||
} else {
|
} else {
|
||||||
ret = (jlong) taos_use_result(tscon);
|
ret = (jlong) taos_use_result(tscon);
|
||||||
jniTrace("jobj:%p, conn:%p, get resultset:%p", jobj, tscon, (void *) ret);
|
jniTrace("jobj:%p, conn:%p, get resultset:%p", jobj, tscon, (void *) ret);
|
||||||
|
@ -496,7 +499,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeConnectionIm
|
||||||
jlong con) {
|
jlong con) {
|
||||||
TAOS *tscon = (TAOS *)con;
|
TAOS *tscon = (TAOS *)con;
|
||||||
if (tscon == NULL) {
|
if (tscon == NULL) {
|
||||||
jniError("jobj:%p, connection is closed", jobj);
|
jniError("jobj:%p, connection is already closed", jobj);
|
||||||
return JNI_CONNECTION_NULL;
|
return JNI_CONNECTION_NULL;
|
||||||
} else {
|
} else {
|
||||||
jniTrace("jobj:%p, conn:%p, close connection success", jobj, tscon);
|
jniTrace("jobj:%p, conn:%p, close connection success", jobj, tscon);
|
||||||
|
|
|
@ -279,8 +279,7 @@ bool httpReadChunkedBody(HttpContext* pContext, HttpParser* pParser) {
|
||||||
httpParseChunkedBody(pContext, pParser, false);
|
httpParseChunkedBody(pContext, pParser, false);
|
||||||
return HTTP_CHECK_BODY_SUCCESS;
|
return HTTP_CHECK_BODY_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
httpTrace("context:%p, fd:%d, ip:%s, chunked body not finished, continue read", pContext, pContext->fd,
|
httpTrace("context:%p, fd:%d, ip:%s, chunked body not finished, continue read", pContext, pContext->fd, pContext->ipstr);
|
||||||
pContext->ipstr);
|
|
||||||
if (!httpReadDataImp(pContext)) {
|
if (!httpReadDataImp(pContext)) {
|
||||||
httpError("context:%p, fd:%d, ip:%s, read chunked request error", pContext, pContext->fd, pContext->ipstr);
|
httpError("context:%p, fd:%d, ip:%s, read chunked request error", pContext, pContext->fd, pContext->ipstr);
|
||||||
return HTTP_CHECK_BODY_ERROR;
|
return HTTP_CHECK_BODY_ERROR;
|
||||||
|
|
|
@ -101,7 +101,7 @@ void httpFreeContext(HttpServer *pServer, HttpContext *pContext) {
|
||||||
void httpCleanUpContextTimer(HttpContext *pContext) {
|
void httpCleanUpContextTimer(HttpContext *pContext) {
|
||||||
if (pContext->timer != NULL) {
|
if (pContext->timer != NULL) {
|
||||||
taosTmrStopA(&pContext->timer);
|
taosTmrStopA(&pContext->timer);
|
||||||
httpTrace("context:%p, ip:%s, close timer:%p", pContext, pContext->ipstr, pContext->timer);
|
//httpTrace("context:%p, ip:%s, close timer:%p", pContext, pContext->ipstr, pContext->timer);
|
||||||
pContext->timer = NULL;
|
pContext->timer = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,8 +329,6 @@ bool httpReadDataImp(HttpContext *pContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pParser->buffer[pParser->bufsize] = 0;
|
pParser->buffer[pParser->bufsize] = 0;
|
||||||
httpTrace("context:%p, fd:%d, ip:%s, thread:%s, read size:%d",
|
|
||||||
pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pParser->bufsize);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -383,10 +381,12 @@ bool httpReadData(HttpThread *pThread, HttpContext *pContext) {
|
||||||
int ret = httpCheckReadCompleted(pContext);
|
int ret = httpCheckReadCompleted(pContext);
|
||||||
if (ret == HTTP_CHECK_BODY_CONTINUE) {
|
if (ret == HTTP_CHECK_BODY_CONTINUE) {
|
||||||
taosTmrReset(httpCloseContextByServerForExpired, HTTP_EXPIRED_TIME, pContext, pThread->pServer->timerHandle, &pContext->timer);
|
taosTmrReset(httpCloseContextByServerForExpired, HTTP_EXPIRED_TIME, pContext, pThread->pServer->timerHandle, &pContext->timer);
|
||||||
httpTrace("context:%p, fd:%d, ip:%s, not finished yet, try another times, timer:%p", pContext, pContext->fd, pContext->ipstr, pContext->timer);
|
//httpTrace("context:%p, fd:%d, ip:%s, not finished yet, try another times, timer:%p", pContext, pContext->fd, pContext->ipstr, pContext->timer);
|
||||||
return false;
|
return false;
|
||||||
} else if (ret == HTTP_CHECK_BODY_SUCCESS){
|
} else if (ret == HTTP_CHECK_BODY_SUCCESS){
|
||||||
httpCleanUpContextTimer(pContext);
|
httpCleanUpContextTimer(pContext);
|
||||||
|
httpTrace("context:%p, fd:%d, ip:%s, thread:%s, read size:%d, dataLen:%d",
|
||||||
|
pContext, pContext->fd, pContext->ipstr, pContext->pThread->label, pContext->parser.bufsize, pContext->parser.data.len);
|
||||||
if (httpDecompressData(pContext)) {
|
if (httpDecompressData(pContext)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue