support server cookie

This commit is contained in:
pingfang 2020-03-25 19:12:44 +08:00
parent 03d9cba043
commit 71cb7bec0b
3 changed files with 11 additions and 0 deletions

View File

@ -109,6 +109,9 @@ void AsyncProcThread::callback(ReqMessage * msg)
pServantProxyThreadData->_dyeing = msg->bDyeing;
pServantProxyThreadData->_dyeingKey = msg->sDyeingKey;
pServantProxyThreadData->_hasCookie = msg->hasCookie;
pServantProxyThreadData->_cookie = msg->cookie;
if(msg->adapter)
{
pServantProxyThreadData->_szHost = msg->adapter->endpoint().desc();

View File

@ -573,6 +573,9 @@ void ServantProxy::invoke(ReqMessage * msg, bool bCoroAsync)
TLOGTARS("[TARS][ServantProxy::invoke, set dyeing, key=" << pSptd->_dyeingKey << endl);
}
msg->hasCookie = pSptd->_hasCookie;
msg->cookie = pSptd->_cookie;
#ifdef _USE_OPENTRACKING
msg->trackInfoMap = pSptd->_trackInfoMap;

View File

@ -203,6 +203,7 @@ struct ReqMessage : public TC_HandleBase
, bCoroFlag(false)
, sched(NULL)
, iCoroId(0)
, hasCookie(0)
{
}
@ -250,6 +251,7 @@ struct ReqMessage : public TC_HandleBase
bCoroFlag = false;
sched = NULL;
iCoroId = 0;
hasCookie = false;
}
@ -292,6 +294,9 @@ struct ReqMessage : public TC_HandleBase
#ifdef _USE_OPENTRACKING
std::unordered_map<std::string, std::string> trackInfoMap; //调用链信息
#endif
bool hasCookie; // 是否包含cookie
map<string, string> cookie; // cookie内容
};
typedef TC_AutoPtr<ReqMessage> ReqMessagePtr;