Skip to content

Commit

Permalink
Merge pull request #185 from joyieldInc/fix/issue124
Browse files Browse the repository at this point in the history
avoid to use leader's connection for follow request
  • Loading branch information
fortrue authored Jan 31, 2024
2 parents c15f54e + 9b85bd0 commit ca1630a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Request::~Request()

void Request::clear()
{
mConn = nullptr;
mRes = nullptr;
mHead.clear();
mReq.clear();
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Request.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Request :
bool isDone() const;
AcceptConnection* connection() const
{
return mLeader ? mLeader->mConn : mConn;
return mConn;
}
void detach()
{
Expand Down

0 comments on commit ca1630a

Please sign in to comment.