diff --git a/servant/libservant/AsyncProcThread.cpp b/servant/libservant/AsyncProcThread.cpp index c64781c..2357d7e 100644 --- a/servant/libservant/AsyncProcThread.cpp +++ b/servant/libservant/AsyncProcThread.cpp @@ -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(); diff --git a/servant/libservant/ServantProxy.cpp b/servant/libservant/ServantProxy.cpp index 96b9e7d..e601813 100644 --- a/servant/libservant/ServantProxy.cpp +++ b/servant/libservant/ServantProxy.cpp @@ -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; diff --git a/servant/servant/Message.h b/servant/servant/Message.h index 8760e39..df01042 100644 --- a/servant/servant/Message.h +++ b/servant/servant/Message.h @@ -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 trackInfoMap; //调用链信息 #endif + + bool hasCookie; // 是否包含cookie + map cookie; // cookie内容 }; typedef TC_AutoPtr ReqMessagePtr;