Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix problems with ASIWebPageRequest and maxConcurrentOperationCount #253

Closed
pokeb opened this Issue · 3 comments

3 participants

@RadhikaS

There is a temporary fix for the problem that works for me. The problem is,upon request timeout ASIWebpageRequest never calls super class(ASIHttpRequest) method markAsFinished which makes the timed out request to remain in the queue.

I made the changes to ASIWebPageRequest.m

1.In markAsFinished method

  • (void)markAsFinished { if (error) { [super markAsFinished]; }

}

Added the [super markAsFinished] call in case of an error.

  1. In externalResourceFetchFailed method

  • (void)externalResourceFetchFailed:(ASIHTTPRequest *)externalResourceRequest { if([[self externalResourceQueue] shouldCancelAllRequestsOnFailure]){ [self failWithError:[externalResourceRequest error]]; } }

After making these changes i was able to download the webpage eventhough there are few timeouts and failures.
Note: Need to add the line [[self externalResourceQueue] setShouldCancelAllRequestsOnFailure:NO]; to the methods parseAsHTML and parseAsCSS as mentioned in the bug.

@pokeb pokeb closed this issue from a commit
@pokeb ASIWebPageRequest: Fix from @RadhikaS that:
* Ensures external resource requests are properly removed from the queue and released when they fail
* Changes behaviour so that by default, external resource request failures do not cause everything else to fail

Also added new shouldIgnoreExternalResourceErrors property to control this

closes gh-253
f7fe5c7
@pokeb pokeb closed this in f7fe5c7
@pokeb
Owner

Thanks @RadhikaS - I have incorporated your fix! :)

@RalphsApps

Hi Ben,

I think there is unfortunately an issue with your implementation.

"should ignore errors" is not the same as "should cancel"

[[self externalResourceQueue] setShouldCancelAllRequestsOnFailure:[self shouldIgnoreExternalResourceErrors]];

I think you are missing a " ! " in this line.

Thank you and
Best Regards,
Ralph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.