From 0d3e4ae28dfbb4bc76975131f14bebdfd001bc25 Mon Sep 17 00:00:00 2001 From: Vlas Voloshin Date: Mon, 30 Sep 2013 18:02:58 +0400 Subject: [PATCH] fixed initial upload/download task progress updates --- AFNetworking/AFURLSessionManager.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AFNetworking/AFURLSessionManager.m b/AFNetworking/AFURLSessionManager.m index f2ee3f4..f35b4a3 100644 --- a/AFNetworking/AFURLSessionManager.m +++ b/AFNetworking/AFURLSessionManager.m @@ -127,8 +127,8 @@ typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id re totalBytesSent:(int64_t)totalBytesSent totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend { - self.uploadProgress.completedUnitCount = totalBytesSent; self.uploadProgress.totalUnitCount = totalBytesExpectedToSend; + self.uploadProgress.completedUnitCount = totalBytesSent; } - (void)URLSession:(__unused NSURLSession *)session @@ -229,16 +229,16 @@ didFinishDownloadingToURL:(NSURL *)location totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite { - self.downloadProgress.completedUnitCount = totalBytesWritten; self.downloadProgress.totalUnitCount = totalBytesExpectedToWrite; + self.downloadProgress.completedUnitCount = totalBytesWritten; } - (void)URLSession:(__unused NSURLSession *)session downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes { - self.downloadProgress.completedUnitCount = fileOffset; self.downloadProgress.totalUnitCount = expectedTotalBytes; + self.downloadProgress.completedUnitCount = fileOffset; } @end