Merge pull request #185 from joyieldInc/fix/issue124

avoid to use leader's connection for follow request
This commit is contained in:
fortrue 2024-01-31 11:40:02 +08:00 committed by GitHub
commit ca1630a6b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -103,6 +103,7 @@ Request::~Request()
void Request::clear()
{
mConn = nullptr;
mRes = nullptr;
mHead.clear();
mReq.clear();
@ -293,6 +294,7 @@ void Request::follow(Request* leader)
if (leader == this) {
return;
}
mConn = leader->mConn;
mType = leader->mType;
mHead = leader->mHead;
mReq = leader->mReq;

View File

@ -71,7 +71,7 @@ public:
bool isDone() const;
AcceptConnection* connection() const
{
return mLeader ? mLeader->mConn : mConn;
return mConn;
}
void detach()
{