Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Android implementation of HTTPClient throwing up java.io.IOException #1055

Closed
UnreachableCode opened this issue Jan 17, 2019 · 3 comments
Closed

Comments

@UnreachableCode
Copy link

UnreachableCode commented Jan 17, 2019

I believe this relates to the bug detailed in Xamarin's old Bugzilla:
https://bugzilla.xamarin.com/show_bug.cgi?id=41100

and is also similar to the issue discussed here:
square/okhttp#1517

Here is the main stacktrace of my issue:

LoginProvider+d__1.MoveNext () C:\source\repos{MyApp}{MyApp}{MyApp}\Services\LoginProvider.cs:35
java.io.IOException: unexpected end of stream on Connection{testclarity.i-menzies.com:443, proxy=DIRECT@ hostAddress=62.244.173.166 cipherSuite=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 protocol=http/1.1} (recycle count=0)
com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:210)
com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:905)
com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:789)
com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443)
com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)
com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
Caused by: java.io.EOFException: \n not found: size=0 content=...
com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:200)
com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)

I have tried setting the connection closed header and setting chunked transfer encoding but neither of these fixes work. I would try to set the OkHTTP.setRetryOnConnectionFailure(true) but I don't think there is a way to do this in the referenced Java source.

@terrajobst
Copy link
Member

@marek-safar is bugzilla still the right location for filing Xamarin bugs?

@marek-safar
Copy link

No, use https://github.com/xamarin/xamarin-android/ for new issues

@terrajobst
Copy link
Member

terrajobst commented Jan 24, 2019

Since your issue is implementation specific, I've moved it to dotnet/android#2651

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

No branches or pull requests

3 participants