Skip to content

Commit 913303c

Browse files
committed
Minor code cleanup
1 parent 0714713 commit 913303c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

GCD/GCDAsyncSocket.m

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,11 +3632,20 @@ - (BOOL)usingCFStreamForTLS
36323632

36333633
- (BOOL)usingSecureTransportForTLS
36343634
{
3635+
// Invoking this method is equivalent to ![self usingCFStreamForTLS] (just more readable)
3636+
36353637
#if TARGET_OS_IPHONE
3636-
return ![self usingCFStreamForTLS];
3637-
#else
3638-
return YES;
3638+
3639+
if ((flags & kSocketSecure) && (flags & kUsingCFStreamForTLS))
3640+
{
3641+
// The startTLS method was given the GCDAsyncSocketUseCFStreamForTLS flag.
3642+
3643+
return NO;
3644+
}
3645+
36393646
#endif
3647+
3648+
return YES;
36403649
}
36413650

36423651
- (void)suspendReadSource
@@ -4139,7 +4148,7 @@ - (void)doReadData
41394148
{
41404149
#if TARGET_OS_IPHONE
41414150

4142-
// Relegated to using CFStream... :( Boo! Give us a full SecureTransport stack Apple!
4151+
// Requested CFStream, rather than SecureTransport, for TLS (via GCDAsyncSocketUseCFStreamForTLS)
41434152

41444153
estimatedBytesAvailable = 0;
41454154
if ((flags & kSecureSocketHasBytesAvailable) && CFReadStreamHasBytesAvailable(readStream))

0 commit comments

Comments
 (0)