Fix invalid state when disconnecting idle socket during connect

pull/808/head
klzgrad 2026-05-07 19:25:57 +08:00
parent 6d82f7ddaf
commit b5bda24ebe
1 changed files with 4 additions and 1 deletions

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);