I am trying to make use of loopj's Async HTTP library, but I encountered quite critical problem. When I am making a request to a host that does not exist it goes into infinite loop.
I tried debugging the code, but I didn't find much:
com.loopj.android.http.AsyncHttpRequest.run()
runs and calls com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries()
makeRequestWithRetries()
com.loopj.android.http.AsyncHttpRequest.makeRequest()
is called which throws ConnectTimeoutException
that looks like it is being caught by IOException
catch and com.loopj.android.http.RetryHandler.retryRequest(IOException, int, HttpContext)
is called.com.loopj.android.http.AsyncHttpResponseHandler.handleMessage(Message)
and no message is fired, it just gets stuck.However I am able to cancel this request with com.loopj.android.http.AsyncHttpClient.cancelRequests(Context, boolean)
.
I have te newest possible code, because I got it yesterday from github and build myself.
I appreciate any help.
Mentioned this in a comment, but I was having the same issue, and can confirm that the latest version of the library fixes this issue.
See this pull request: https://github.com/loopj/android-async-http/commit/87a615c3b86c3e33bd885435f98ab33483f874e9