Skip to content

Commit 1ee2e65

Browse files
committed
GCDAsyncSocket: fixed bug: socket was closed with nil error if SecureTransport is unavaliable.
In case if IS_SECURE_TRANSPORT_AVAILABLE == NO, in 'doReadEOF' method code for creating connectionClosedError wasn't called.
1 parent 7b7f54b commit 1ee2e65

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

GCD/GCDAsyncSocket.m

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4973,23 +4973,25 @@ - (void)doReadEOF
49734973
{
49744974
if (error == nil)
49754975
{
4976-
if ([self usingSecureTransportForTLS])
4977-
{
4978-
#if SECURE_TRANSPORT_MAYBE_AVAILABLE
4979-
if (sslErrCode != noErr && sslErrCode != errSSLClosedGraceful)
4976+
#if SECURE_TRANSPORT_MAYBE_AVAILABLE
4977+
if ([self usingSecureTransportForTLS])
49804978
{
4981-
error = [self sslError:sslErrCode];
4979+
if (sslErrCode != noErr && sslErrCode != errSSLClosedGraceful)
4980+
{
4981+
error = [self sslError:sslErrCode];
4982+
}
4983+
else
4984+
{
4985+
error = [self connectionClosedError];
4986+
}
49824987
}
49834988
else
49844989
{
49854990
error = [self connectionClosedError];
49864991
}
4987-
#endif
4988-
}
4989-
else
4990-
{
4991-
error = [self connectionClosedError];
4992-
}
4992+
#else
4993+
error = [self connectionClosedError];
4994+
#endif
49934995
}
49944996
[self closeWithError:error];
49954997
}

0 commit comments

Comments
 (0)