提交 88ed8d4c 编写于 作者: dengyihao's avatar dengyihao

refactor code

上级 1fea5e56
......@@ -313,6 +313,11 @@ int taos_options_imp(TSDB_OPTION option, const char* str);
void* openTransporter(const char* user, const char* auth, int32_t numOfThreads);
typedef struct AsyncArg {
SRpcMsg msg;
SEpSet* pEpset;
} AsyncArg;
bool persistConnForSpecificMsg(void* parenct, tmsg_t msgType);
void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet);
......
......@@ -1269,13 +1269,8 @@ void updateTargetEpSet(SMsgSendInfo* pSendInfo, STscObj* pTscObj, SRpcMsg* pMsg,
}
}
typedef struct SchedArg {
SRpcMsg msg;
SEpSet* pEpset;
} SchedArg;
int32_t doProcessMsgFromServer(void* param) {
SchedArg* arg = (SchedArg*)param;
AsyncArg* arg = (AsyncArg*)param;
SRpcMsg* pMsg = &arg->msg;
SEpSet* pEpSet = arg->pEpset;
......@@ -1338,7 +1333,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
memcpy((void*)tEpSet, (void*)pEpSet, sizeof(SEpSet));
}
SchedArg* arg = taosMemoryCalloc(1, sizeof(SchedArg));
AsyncArg* arg = taosMemoryCalloc(1, sizeof(AsyncArg));
arg->msg = *pMsg;
arg->pEpset = tEpSet;
......@@ -1478,7 +1473,7 @@ void* doAsyncFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertU
tsem_wait(&pParam->sem);
}
if (pResultInfo->numOfRows == 0 || pRequest->code != TSDB_CODE_SUCCESS) {
if (pResultInfo->numOfRows == 0 || pRequest->code != TSDB_CODE_SUCCESS) {
return NULL;
} else {
if (setupOneRowPtr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册