Fix incorrect CHECK during client-side early pull

This commit is contained in:
klzgrad 2023-08-21 15:29:32 +08:00
parent 8ef1cecadf
commit 9196d698eb

View File

@ -301,12 +301,13 @@ int NaiveConnection::DoConnectServerComplete(int result) {
} }
int NaiveConnection::Run(CompletionOnceCallback callback) { int NaiveConnection::Run(CompletionOnceCallback callback) {
DCHECK(sockets_[kClient]);
DCHECK(sockets_[kServer]); DCHECK(sockets_[kServer]);
DCHECK_EQ(next_state_, STATE_NONE); DCHECK_EQ(next_state_, STATE_NONE);
DCHECK(!connect_callback_); DCHECK(!connect_callback_);
if (errors_[kClient] != OK) // The client-side socket may be closed before the server-side
// socket is connected.
if (errors_[kClient] != OK || sockets_[kClient] == nullptr)
return errors_[kClient]; return errors_[kClient];
if (errors_[kServer] != OK) if (errors_[kServer] != OK)
return errors_[kServer]; return errors_[kServer];