Skip to content

Commit a67b521

Browse files
committed
apply gxu patch
1 parent 84f423d commit a67b521

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scaler/io/ymq/tcp_client.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ void TcpClient::onCreated()
7070
sock->onConnectionCreated(setNoDelay(sockfd), getLocalAddr(sockfd), getRemoteAddr(sockfd), responsibleForRetry);
7171
if (_retryTimes == 0) {
7272
_onConnectReturn({});
73+
_onConnectReturn = {};
7374
}
7475
return;
7576
}
@@ -78,6 +79,7 @@ void TcpClient::onCreated()
7879
_eventLoopThread->_eventLoop.addFdToLoop(sockfd, EPOLLOUT | EPOLLET, this->_eventManager.get());
7980
if (_retryTimes == 0) {
8081
_onConnectReturn(std::unexpected {Error::ErrorCode::InitialConnectFailedWithInProgress});
82+
_onConnectReturn = {};
8183
}
8284
return;
8385
}
@@ -361,6 +363,9 @@ TcpClient::~TcpClient() noexcept
361363
if (_retryTimes > 0) {
362364
_eventLoopThread->_eventLoop.cancelExecution(_retryIdentifier);
363365
}
366+
if (_onConnectReturn) {
367+
_onConnectReturn({});
368+
}
364369
}
365370

366371
} // namespace ymq

0 commit comments

Comments
 (0)