From 472ba1c66aac6065acc01c7dbf525508566e0c24 Mon Sep 17 00:00:00 2001 From: Jean-Francois Morin Date: Tue, 16 Apr 2013 11:00:26 +0300 Subject: [PATCH] Replace NSData by NSUInteger in connection:didReceiveData: Signed-off-by: Mattt Thompson --- AFNetworking/AFURLConnectionOperation.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index 9e24e9f..382b01e 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -738,16 +738,17 @@ didReceiveResponse:(NSURLResponse *)response - (void)connection:(NSURLConnection __unused *)connection didReceiveData:(NSData *)data { + NSUInteger length = [data length]; if ([self.outputStream hasSpaceAvailable]) { const uint8_t *dataBuffer = (uint8_t *) [data bytes]; - [self.outputStream write:&dataBuffer[0] maxLength:[data length]]; + [self.outputStream write:&dataBuffer[0] maxLength:length]; } dispatch_async(dispatch_get_main_queue(), ^{ - self.totalBytesRead += [data length]; + self.totalBytesRead += length; if (self.downloadProgress) { - self.downloadProgress([data length], self.totalBytesRead, self.response.expectedContentLength); + self.downloadProgress(length, self.totalBytesRead, self.response.expectedContentLength); } }); }