Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASIHTTPRequest synchronous request with stub never ends #133

Open
yuriy-tolstoguzov opened this issue Jan 26, 2016 · 1 comment
Open

ASIHTTPRequest synchronous request with stub never ends #133

yuriy-tolstoguzov opened this issue Jan 26, 2016 · 1 comment

Comments

@yuriy-tolstoguzov
Copy link

I don't know is it still in your list of priorities, but I found out that your library does not want to work with ASIHTTPRequest correctly. My AFNetworking requests finished successfully, but ASIHTTPRequest request that starts synchronously never leaves this loop (ASIHTTPRequest:765, method -startSynchronous):

if (![self isCancelled] && ![self complete]) {
    [self main];
    while (!complete) {
        [[NSRunLoop currentRunLoop] runMode:[self runLoopMode] beforeDate:[NSDate distantFuture]];
    }
}

After Nocilla calls -requestFinished this local variable (complete) stays the same.

@yuriy-tolstoguzov yuriy-tolstoguzov changed the title ASIHTTPRequest synchronous requests never ends with stub ASIHTTPRequest synchronous request with stub never ends Jan 26, 2016
@andrewkboyd
Copy link
Collaborator

[NSDate distantFuture] is going to cause this code to wait indefinitely and never check your complete variable. Change this to something like [NSDate dateWithTimeIntervalSinceNow:1.0] and see if that helps.

If you still see issues, provide sample code so that we can test/reproduce ourselves and look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants