From a9ed36e16714c0b4f2a7159dbbbf5a94f95e9637 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Tue, 10 Oct 2023 16:53:15 +0800 Subject: [PATCH] enh: send rpc rsp on error of tmsgPutToQueue --- source/libs/transport/src/tmsgcb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/transport/src/tmsgcb.c b/source/libs/transport/src/tmsgcb.c index fc95cab76e..1b1fa8cc1c 100644 --- a/source/libs/transport/src/tmsgcb.c +++ b/source/libs/transport/src/tmsgcb.c @@ -26,6 +26,10 @@ void tmsgSetDefault(const SMsgCb* msgcb) { defaultMsgCb = *msgcb; } int32_t tmsgPutToQueue(const SMsgCb* msgcb, EQueueType qtype, SRpcMsg* pMsg) { int32_t code = (*msgcb->putToQueueFp)(msgcb->mgmt, qtype, pMsg); if (code != 0) { + SRpcMsg rsp = {.code = code, .info = pMsg->info}; + if (rsp.info.handle != NULL) { + tmsgSendRsp(&rsp); + } rpcFreeCont(pMsg->pCont); pMsg->pCont = NULL; }