Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix some issues with progress create by last changeset

  • Loading branch information...
commit 7aca62d514c4b0523e1150695d1b9bdd9f66a615 1 parent 8c2584d
@pokeb authored
Showing with 4 additions and 15 deletions.
  1. +2 −15 Classes/ASIHTTPRequest.m
  2. +2 −0  Classes/ASINetworkQueue.m
View
17 Classes/ASIHTTPRequest.m
@@ -398,16 +398,14 @@ - (void)startRequest
lastBytesRead = 0;
// If we're retrying a request after an authentication failure, let's remove any progress we made
- if (lastBytesSent > 0 && uploadProgressDelegate) {
+ if (lastBytesSent > 0) {
[self removeUploadProgressSoFar];
}
lastBytesSent = 0;
if (shouldResetProgressIndicators) {
contentLength = 0;
- if (downloadProgressDelegate) {
- [self resetDownloadProgress:0];
- }
+ [self resetDownloadProgress:0];
}
[self setResponseHeaders:nil];
if (![self downloadDestinationPath]) {
@@ -633,17 +631,6 @@ - (void)resetUploadProgress:(unsigned long long)value
{
[progressLock lock];
- //We're using a progress queue or compatible controller to handle progress
- SEL selector = @selector(incrementUploadSizeBy:);
- if ([queue respondsToSelector:selector]) {
- NSMethodSignature *signature = [[queue class] instanceMethodSignatureForSelector:selector];
- NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
- [invocation setTarget:queue];
- [invocation setSelector:selector];
- [invocation setArgument:&value atIndex:2];
- [invocation invoke];
- }
-
// Request this request's own upload progress delegate
if (uploadProgressDelegate) {
[ASIHTTPRequest setProgress:0 forProgressIndicator:uploadProgressDelegate];
View
2  Classes/ASINetworkQueue.m
@@ -137,6 +137,7 @@ - (void)addOperation:(NSOperation *)operation
//Tell the request not to reset the progress indicator when it gets a content-length, as we will get the length from the HEAD request
[request setShouldResetProgressIndicators:NO];
+
[request addDependency:HEADRequest];
// If we want to track uploading for this request accurately, we need to add the size of the post content to the total
@@ -146,6 +147,7 @@ - (void)addOperation:(NSOperation *)operation
}
}
[request setShowAccurateProgress:showAccurateProgress];
+
[request setQueue:self];
[super addOperation:request];
Please sign in to comment.
Something went wrong with that request. Please try again.