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 callscom.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries()- Then inside
makeRequestWithRetries()com.loopj.android.http.AsyncHttpRequest.makeRequest()is called which throwsConnectTimeoutExceptionthat looks like it is being caught byIOExceptioncatch andcom.loopj.android.http.RetryHandler.retryRequest(IOException, int, HttpContext)is called. - Then I app is not caught in any previous breakpoints, not even
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