0

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:

  1. com.loopj.android.http.AsyncHttpRequest.run() runs and calls com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries()
  2. Then inside 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.
  3. 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.

BartoszCichecki
  • 2,227
  • 4
  • 28
  • 41
  • Did you find a solution to this? I'm running into the same issue and this must be a major use/error case for everyone using the library.. – ch3rryc0ke Jan 22 '13 at 20:59
  • Unfortunately not. I gave this up for now because of the deadlines. I will have to come back this later. – BartoszCichecki Jan 24 '13 at 08:04
  • 1
    The latest version of the library has fixed this issue.. including the connection timeout now working properly! – ch3rryc0ke Feb 02 '13 at 01:03

1 Answers1

1

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

ch3rryc0ke
  • 2,793
  • 1
  • 22
  • 28