Skip to content

Commit ac324ac

Browse files
committed
Fix testConnectTimeout
1 parent c7eae14 commit ac324ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ClientConnection.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,11 @@ void ClientConnection::handleTcpConnected(const ASIO_ERROR& err, const tcp::endp
489489
}
490490
} else {
491491
LOG_ERROR(cnxString_ << "Failed to establish connection: " << err.message());
492-
close(ResultRetryable);
492+
if (err == ASIO::error::operation_aborted) {
493+
close();
494+
} else {
495+
close(ResultRetryable);
496+
}
493497
}
494498
}
495499

@@ -620,7 +624,7 @@ void ClientConnection::handleResolve(ASIO_ERROR err, const tcp::resolver::result
620624
}
621625
ptr->connectTimeoutTask_->stop();
622626
});
623-
627+
connectTimeoutTask_->start();
624628
ASIO::async_connect(*socket_, results, [weakSelf](const ASIO_ERROR& err, const tcp::endpoint& endpoint) {
625629
auto self = weakSelf.lock();
626630
if (self) {

0 commit comments

Comments
 (0)