handle except
This commit is contained in:
parent
23ac4cbc93
commit
3876bf7212
|
@ -196,7 +196,10 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) {
|
||||||
CONN_GET_MSGCTX_BY_AHANDLE(conn, ahandle); \
|
CONN_GET_MSGCTX_BY_AHANDLE(conn, ahandle); \
|
||||||
transClearBuffer(&conn->readBuf); \
|
transClearBuffer(&conn->readBuf); \
|
||||||
transFreeMsg(transContFromHead((char*)head)); \
|
transFreeMsg(transContFromHead((char*)head)); \
|
||||||
if (transQueueSize(&conn->cliMsgs) > 0 && ahandle == 0) return; \
|
if (transQueueSize(&conn->cliMsgs) > 0 && ahandle == 0) { \
|
||||||
|
SCliMsg* cliMsg = transQueueGet(&conn->cliMsgs, 0); \
|
||||||
|
if (cliMsg->type == Release) return; \
|
||||||
|
} \
|
||||||
tDebug("%s conn %p receive release request, ref:%d", CONN_GET_INST_LABEL(conn), conn, T_REF_VAL_GET(conn)); \
|
tDebug("%s conn %p receive release request, ref:%d", CONN_GET_INST_LABEL(conn), conn, T_REF_VAL_GET(conn)); \
|
||||||
if (T_REF_VAL_GET(conn) > 1) { \
|
if (T_REF_VAL_GET(conn) > 1) { \
|
||||||
transUnrefCliHandle(conn); \
|
transUnrefCliHandle(conn); \
|
||||||
|
|
|
@ -397,11 +397,11 @@ static void uvPrepareSendData(SSvrMsg* smsg, uv_buf_t* wb) {
|
||||||
|
|
||||||
if (pConn->status == ConnNormal) {
|
if (pConn->status == ConnNormal) {
|
||||||
pHead->msgType = (0 == pMsg->msgType ? pConn->inType + 1 : pMsg->msgType);
|
pHead->msgType = (0 == pMsg->msgType ? pConn->inType + 1 : pMsg->msgType);
|
||||||
|
if (smsg->type == Release) pHead->msgType = 0;
|
||||||
} else {
|
} else {
|
||||||
if (smsg->type == Release) {
|
if (smsg->type == Release) {
|
||||||
pHead->msgType = 0;
|
pHead->msgType = 0;
|
||||||
pConn->status = ConnNormal;
|
pConn->status = ConnNormal;
|
||||||
|
|
||||||
destroyConnRegArg(pConn);
|
destroyConnRegArg(pConn);
|
||||||
transUnrefSrvHandle(pConn);
|
transUnrefSrvHandle(pConn);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue