Merge branch '3.0' into enh/opt-transport
This commit is contained in:
parent
d6e7189201
commit
eb6053ffc5
|
@ -889,6 +889,7 @@ static void cliRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
|
||||||
while (transReadComplete(pBuf)) {
|
while (transReadComplete(pBuf)) {
|
||||||
tTrace("%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) {
|
if (pBuf->invalid) {
|
||||||
|
conn->broken = true;
|
||||||
transUnrefCliHandle(conn);
|
transUnrefCliHandle(conn);
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
@ -1191,6 +1192,10 @@ bool cliConnMayAddUserInfo(SCliConn* pConn, STransMsgHead** ppHead, int32_t* msg
|
||||||
int32_t cliBatchSend(SCliConn* pConn) {
|
int32_t cliBatchSend(SCliConn* pConn) {
|
||||||
SCliThrd* pThrd = pConn->hostThrd;
|
SCliThrd* pThrd = pConn->hostThrd;
|
||||||
STrans* pInst = pThrd->pInst;
|
STrans* pInst = pThrd->pInst;
|
||||||
|
|
||||||
|
if (pConn->broken) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int32_t size = transQueueSize(&pConn->reqsToSend);
|
int32_t size = transQueueSize(&pConn->reqsToSend);
|
||||||
|
|
||||||
int32_t totalLen = 0;
|
int32_t totalLen = 0;
|
||||||
|
@ -1263,7 +1268,6 @@ int32_t cliBatchSend(SCliConn* pConn) {
|
||||||
TMSG_INFO(pReq->msgType), pConn->dst, pConn->src, pConn->seq, pReq->info.qId);
|
TMSG_INFO(pReq->msgType), pConn->dst, pConn->src, pConn->seq, pReq->info.qId);
|
||||||
transQueuePush(&pConn->reqsSentOut, &pCliMsg->q);
|
transQueuePush(&pConn->reqsSentOut, &pCliMsg->q);
|
||||||
}
|
}
|
||||||
|
|
||||||
transRefCliHandle(pConn);
|
transRefCliHandle(pConn);
|
||||||
uv_write_t* req = allocWReqFromWQ(&pConn->wq, pConn);
|
uv_write_t* req = allocWReqFromWQ(&pConn->wq, pConn);
|
||||||
tDebug("%s conn %p start to send msg, batch size:%d, len:%d", CONN_GET_INST_LABEL(pConn), pConn, size, totalLen);
|
tDebug("%s conn %p start to send msg, batch size:%d, len:%d", CONN_GET_INST_LABEL(pConn), pConn, size, totalLen);
|
||||||
|
|
|
@ -614,6 +614,7 @@ void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) {
|
||||||
if (true == pBuf->invalid || false == uvHandleReq(conn)) {
|
if (true == pBuf->invalid || false == uvHandleReq(conn)) {
|
||||||
tError("%s conn %p read invalid packet, received from %s, local info:%s", transLabel(pInst), conn, conn->dst,
|
tError("%s conn %p read invalid packet, received from %s, local info:%s", transLabel(pInst), conn, conn->dst,
|
||||||
conn->src);
|
conn->src);
|
||||||
|
conn->broken = true;
|
||||||
transUnrefSrvHandle(conn);
|
transUnrefSrvHandle(conn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue