fix: opt trans debug info
This commit is contained in:
parent
0d5aad85f8
commit
f6ca06ef2b
|
@ -223,9 +223,13 @@ static void cliWalkCb(uv_handle_t* handle, void* arg);
|
|||
} while (0);
|
||||
|
||||
// snprintf may cause performance problem
|
||||
#define CONN_CONSTRUCT_HASH_KEY(key, ip, port) \
|
||||
do { \
|
||||
snprintf(key, sizeof(key), "%s:%d", ip, (int)port); \
|
||||
#define CONN_CONSTRUCT_HASH_KEY(key, ip, port) \
|
||||
do { \
|
||||
char* p = key; \
|
||||
int32_t len = strlen(ip); \
|
||||
if (p != NULL) memcpy(p, ip, len); \
|
||||
p[len] = ':'; \
|
||||
titoa(port, 10, &p[len + 1]); \
|
||||
} while (0)
|
||||
|
||||
#define CONN_PERSIST_TIME(para) ((para) <= 90000 ? 90000 : (para))
|
||||
|
@ -663,7 +667,7 @@ static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) {
|
|||
static void cliAllocRecvBufferCb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
|
||||
SCliConn* conn = handle->data;
|
||||
SConnBuffer* pBuf = &conn->readBuf;
|
||||
tDebug("%s conn %p alloc read buf", CONN_GET_INST_LABEL(conn), conn);
|
||||
tTrace("%s conn %p alloc read buf", CONN_GET_INST_LABEL(conn), conn);
|
||||
transAllocBuffer(pBuf, buf);
|
||||
}
|
||||
static void cliRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
|
||||
|
@ -676,7 +680,7 @@ static void cliRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
|
|||
if (nread > 0) {
|
||||
pBuf->len += nread;
|
||||
while (transReadComplete(pBuf)) {
|
||||
tDebug("%s conn %p read complete", CONN_GET_INST_LABEL(conn), conn);
|
||||
tTrace("%s conn %p read complete", CONN_GET_INST_LABEL(conn), conn);
|
||||
if (pBuf->invalid) {
|
||||
cliHandleExcept(conn);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue