diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 2a61d34ef4..b9a2eed7a1 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -971,11 +971,6 @@ typedef struct SEpSet { SEp eps[TSDB_MAX_REPLICA]; } SEpSet; -typedef struct { - int8_t inUse; - int8_t numOfEps; - SEp eps[]; -} SReqEpSet; int32_t tEncodeSEpSet(SEncoder* pEncoder, const SEpSet* pEp); int32_t tDecodeSEpSet(SDecoder* pDecoder, SEpSet* pEp); diff --git a/source/libs/transport/inc/transComm.h b/source/libs/transport/inc/transComm.h index 7481c44daf..93f948f7ed 100644 --- a/source/libs/transport/inc/transComm.h +++ b/source/libs/transport/inc/transComm.h @@ -136,35 +136,13 @@ typedef struct SCvtAddr { bool cvt; } SCvtAddr; -int32_t transCreateReqEpsetFromUserEpset(const SEpSet* pEpset, SReqEpSet** pReqEpSet); -int32_t transCreateUserEpsetFromReqEpset(const SReqEpSet* pReqEpSet, SEpSet* pEpSet); +#pragma pack(push, 1) typedef struct { - SReqEpSet* epSet; // ip list provided by app - SReqEpSet* origEpSet; - void* ahandle; // handle provided by app - tmsg_t msgType; // message type - - STransCtx userCtx; // - STransMsg* pRsp; // for synchronous API - tsem_t* pSem; // for synchronous API - STransSyncMsg* pSyncMsg; // for syncchronous with timeout API - int64_t syncMsgRef; - SCvtAddr* pCvtAddr; - - int64_t retryInitTimestamp; - int64_t retryNextInterval; - int64_t retryMaxTimeout; - int32_t retryMinInterval; - int32_t retryMaxInterval; - int32_t retryStepFactor; - int32_t retryStep; - int32_t retryCode; - int8_t retryInit; - int8_t epsetRetryCnt; -} SReqCtx; - -#pragma pack(push, 1) + int8_t inUse; + int8_t numOfEps; + SEp eps[]; +} SReqEpSet; #define TRANS_VER 2 typedef struct { @@ -205,6 +183,33 @@ typedef struct { #pragma pack(pop) +int32_t transCreateReqEpsetFromUserEpset(const SEpSet* pEpset, SReqEpSet** pReqEpSet); +int32_t transCreateUserEpsetFromReqEpset(const SReqEpSet* pReqEpSet, SEpSet* pEpSet); + +typedef struct { + SReqEpSet* epSet; // ip list provided by app + SReqEpSet* origEpSet; + void* ahandle; // handle provided by app + tmsg_t msgType; // message type + + STransCtx userCtx; // + STransMsg* pRsp; // for synchronous API + tsem_t* pSem; // for synchronous API + STransSyncMsg* pSyncMsg; // for syncchronous with timeout API + int64_t syncMsgRef; + SCvtAddr* pCvtAddr; + + int64_t retryInitTimestamp; + int64_t retryNextInterval; + int64_t retryMaxTimeout; + int32_t retryMinInterval; + int32_t retryMaxInterval; + int32_t retryStepFactor; + int32_t retryStep; + int32_t retryCode; + int8_t retryInit; + int8_t epsetRetryCnt; +} SReqCtx; typedef enum { Normal, Quit, Release, Register, Update, FreeById } STransMsgType; typedef enum { ConnNormal, ConnAcquire, ConnRelease, ConnBroken, ConnInPool } ConnStatus;