Skip to content

Commit 7b7f54b

Browse files
committed
Merge branch 'patch-1' of https://github.com/ercollin/CocoaAsyncSocket into ercollin-patch-1
Conflicts: GCD/GCDAsyncSocket.m
2 parents 0957081 + 7eac427 commit 7b7f54b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

GCD/GCDAsyncSocket.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,7 +4219,7 @@ - (void)doReadData
42194219
}
42204220

42214221
BOOL hasBytesAvailable = NO;
4222-
unsigned long estimatedBytesAvailable;
4222+
unsigned long estimatedBytesAvailable = 0;
42234223

42244224
if ([self usingCFStreamForTLS])
42254225
{
@@ -4237,10 +4237,10 @@ - (void)doReadData
42374237
}
42384238
else
42394239
{
4240-
#if SECURE_TRANSPORT_MAYBE_AVAILABLE
4241-
42424240
estimatedBytesAvailable = socketFDBytesAvailable;
42434241

4242+
#if SECURE_TRANSPORT_MAYBE_AVAILABLE
4243+
42444244
if (flags & kSocketSecure)
42454245
{
42464246
// There are 2 buffers to be aware of here.
@@ -4277,9 +4277,9 @@ - (void)doReadData
42774277
estimatedBytesAvailable += sslInternalBufSize;
42784278
}
42794279

4280-
hasBytesAvailable = (estimatedBytesAvailable > 0);
4281-
42824280
#endif
4281+
4282+
hasBytesAvailable = (estimatedBytesAvailable > 0);
42834283
}
42844284

42854285
if ((hasBytesAvailable == NO) && ([preBuffer availableBytes] == 0))
@@ -4884,7 +4884,7 @@ - (void)doReadEOF
48844884
[self flushSSLBuffers];
48854885
}
48864886

4887-
BOOL shouldDisconnect;
4887+
BOOL shouldDisconnect = NO;
48884888
NSError *error = nil;
48894889

48904890
if ((flags & kStartingReadTLS) || (flags & kStartingWriteTLS))
@@ -5011,7 +5011,7 @@ - (void)completeCurrentRead
50115011
NSAssert(currentRead, @"Trying to complete current read when there is no current read.");
50125012

50135013

5014-
NSData *result;
5014+
NSData *result = nil;
50155015

50165016
if (currentRead->bufferOwner)
50175017
{

0 commit comments

Comments
 (0)