refactor transport
This commit is contained in:
parent
32c0c40c4d
commit
ae7d4f1f85
|
@ -435,9 +435,9 @@ bool transEpSetIsEqual2(SEpSet* a, SEpSet* b);
|
|||
*/
|
||||
void transThreadOnce();
|
||||
|
||||
void transInit();
|
||||
void transCleanup();
|
||||
void transPrintEpSet(SEpSet* pEpSet);
|
||||
int32_t transInit();
|
||||
void transCleanup();
|
||||
void transPrintEpSet(SEpSet* pEpSet);
|
||||
|
||||
void transFreeMsg(void* msg);
|
||||
int32_t transCompressMsg(char* msg, int32_t len);
|
||||
|
|
|
@ -34,10 +34,14 @@ static int32_t transValidLocalFqdn(const char* localFqdn, uint32_t* ip) {
|
|||
return 0;
|
||||
}
|
||||
void* rpcOpen(const SRpcInit* pInit) {
|
||||
rpcInit();
|
||||
int32_t code = rpcInit();
|
||||
if (code != 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SRpcInfo* pRpc = taosMemoryCalloc(1, sizeof(SRpcInfo));
|
||||
if (pRpc == NULL) {
|
||||
// return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return NULL;
|
||||
}
|
||||
if (pInit->label) {
|
||||
|
@ -202,10 +206,8 @@ int32_t rpcCvtErrCode(int32_t code) {
|
|||
return code;
|
||||
}
|
||||
|
||||
int32_t rpcInit() {
|
||||
transInit();
|
||||
return 0;
|
||||
}
|
||||
int32_t rpcInit() { return transInit(); }
|
||||
|
||||
void rpcCleanup(void) {
|
||||
transCleanup();
|
||||
transHttpEnvDestroy();
|
||||
|
|
|
@ -692,9 +692,13 @@ static void transDestroyEnv() {
|
|||
transCloseRefMgt(transSyncMsgMgt);
|
||||
}
|
||||
|
||||
void transInit() {
|
||||
int32_t transInit() {
|
||||
// init env
|
||||
taosThreadOnce(&transModuleInit, transInitEnv);
|
||||
int32_t code = taosThreadOnce(&transModuleInit, transInitEnv);
|
||||
if (code != 0) {
|
||||
code = TAOS_SYSTEM_ERROR(errno);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t transGetRefMgt() { return refMgt; }
|
||||
|
|
Loading…
Reference in New Issue