Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix problems with ASIWebPageRequest and maxConcurrentOperationCount #253

Closed
pokeb opened this Issue Sep 1, 2011 · 3 comments

Comments

Projects
None yet
2 participants

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 in f7fe5c7 Sep 19, 2011

Owner

pokeb commented Sep 19, 2011

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

@ghost

ghost commented Sep 21, 2011

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