Skip to content

Commit

Permalink
Merge pull request #56 from conradev/master
Browse files Browse the repository at this point in the history
Handle in-progress connections with grace
  • Loading branch information
wlue committed Apr 27, 2013
2 parents db702af + 241fd2c commit 39df392
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ObjC/PonyDebugger/PDNetworkDomainController.m
Expand Up @@ -510,8 +510,6 @@ - (void)addAccumulatedData:(NSData *)data forConnection:(NSURLConnection *)conne
{
NSMutableData *dataAccumulator = [self requestStateForConnection:connection].dataAccumulator;

NSAssert(dataAccumulator != nil, @"Data accumulator not initialized before adding to it.");

[dataAccumulator appendData:data];
}

Expand Down Expand Up @@ -609,6 +607,8 @@ - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
data = [data copy];
[self performBlock:^{
[self addAccumulatedData:data forConnection:connection];

if ([self accumulatedDataForConnection:connection] == nil) return;

NSNumber *length = [NSNumber numberWithInteger:data.length];
NSString *requestID = [self requestIDForConnection:connection];
Expand Down

0 comments on commit 39df392

Please sign in to comment.