Fix invalid state when disconnecting idle socket during connect

This commit is contained in:
klzgrad
2026-05-07 19:25:57 +08:00
parent 6d82f7ddaf
commit b5bda24ebe

View File

@@ -134,7 +134,10 @@ void NaiveConnection::DoCallback(int result) {
}
void NaiveConnection::OnIOComplete(int result) {
DCHECK_NE(next_state_, STATE_NONE);
if (next_state_ == STATE_NONE) {
// Disconnect() was called during client or server socket Connect().
return;
}
int rv = DoLoop(result);
if (rv != ERR_IO_PENDING) {
DoCallback(rv);