okhttp icon indicating copy to clipboard operation
okhttp copied to clipboard

using volley with okhttp

Open licongqi opened this issue 11 years ago • 1 comments

I was using volley with okhttp. However, I was getting this warning: W/SingleClientConnManager﹕ Invalid use of SingleClientConnManager: connection still allocated. Make sure to release the connection before allocating another one

and this error : NetworkDispatcher.run: Unhandled exception java.lang.IllegalStateException java.lang.IllegalStateException at com.squareup.okhttp.internal.http.HttpEngine.getResponse(HttpEngine.java:416) at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:386) at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495) at com.xxx.http.headresponse.MultiHeaderResponseHurlStack.performRequest(MultiHeaderResponseHurlStack.java:94) at com.xxx.http.multipart.MultiPartStack.performRequest(MultiPartStack.java:48) at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:96) at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)

licongqi avatar Jul 27 '15 09:07 licongqi

Sorry,it's my own fault. I caught the exception in HttpEngine.readResponse() but didn't throw it out, then HttpURLConnectionImpl.execute() returned true which was not correct.

licongqi avatar Jul 28 '15 03:07 licongqi