Ben Copsey

Reinstate code to retain the request for the duration of handleNetworkEvent, as …

…the markAsFinished calls will cause requests to be deallocated
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 #import "ASIDataCompressor.h" 24 #import "ASIDataCompressor.h"
25 25
26 // Automatically set on build 26 // Automatically set on build
27 -NSString *ASIHTTPRequestVersion = @"v1.7-134 2010-11-10"; 27 +NSString *ASIHTTPRequestVersion = @"v1.7-135 2010-11-10";
28 28
29 NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; 29 NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";
30 30
@@ -2875,6 +2875,8 @@ static NSOperationQueue *sharedQueue = nil; @@ -2875,6 +2875,8 @@ static NSOperationQueue *sharedQueue = nil;
2875 return; 2875 return;
2876 } 2876 }
2877 2877
  2878 + CFRetain(self);
  2879 +
2878 // Dispatch the stream events. 2880 // Dispatch the stream events.
2879 switch (type) { 2881 switch (type) {
2880 case kCFStreamEventHasBytesAvailable: 2882 case kCFStreamEventHasBytesAvailable:
@@ -2919,6 +2921,8 @@ static NSOperationQueue *sharedQueue = nil; @@ -2919,6 +2921,8 @@ static NSOperationQueue *sharedQueue = nil;
2919 } else if ([self downloadComplete] && [self authenticationNeeded]) { 2921 } else if ([self downloadComplete] && [self authenticationNeeded]) {
2920 [self attemptToApplyCredentialsAndResume]; 2922 [self attemptToApplyCredentialsAndResume];
2921 } 2923 }
  2924 +
  2925 + CFRelease(self);
2922 } 2926 }
2923 2927
2924 - (void)handleBytesAvailable 2928 - (void)handleBytesAvailable