Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Froyo. #12

Merged
1 commit merged into from
Aug 2, 2012
Merged

Support Froyo. #12

1 commit merged into from
Aug 2, 2012

Conversation

swankjesse
Copy link
Collaborator

This makes a bunch of sad changes for compatibility:

  • Using String.length() rather than String.isEmpty()
  • Using String.getBytes(String) rather than String.getBytes(Charset)
  • Using new String(..., String) rather than new String(..., Charset)
  • Avoiding TimeUnit.DAYS

I've tested this and the HTTP tests run perfectly fine on Froyo.
The HTTPS tests time out due to a bug in Froyo that prevents
its TLS library from working as a server. I manually verified
that TLS works as a client without problem.

I also tested this on Gingerbread. It passes all tests except
for testConnectViaHttpProxyToHttpsUsingProxySystemProperty, which
fails because of a bug in Gingerbread's java.net.ProxySelector.

This change introduces caching reflective objects for NPN access.
That'll make clients that make multiple SSL connections slightly
more efficient.

try {
return new String(out, 0, index, "US-ASCII");
} catch (UnsupportedEncodingException e) {
throw new AssertionError();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why AssertionError, and why not wrap e?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AssertionError means 'this code is unreachable'. I could wrap 'e' but it's mostly academic; because the code is unreachable. This would only trigger on a hypothetical runtime that doesn't include the "US-ASCII" charset, a charset that's required by the spec. (similarly for ISO-8859-1 and UTF-8).

That said, I do like including the 'e' so I'll fix that.

This makes a bunch of sad changes for compatibility:
 - Using String.length() rather than String.isEmpty()
 - Using String.getBytes(String) rather than String.getBytes(Charset)
 - Using new String(..., String) rather than new String(..., Charset)
 - Avoiding TimeUnit.DAYS

I've tested this and the HTTP tests run perfectly fine on Froyo.
The HTTPS tests time out due to a bug in Froyo that prevents
its TLS library from working as a server. I manually verified
that TLS works as a client without problem.

I also tested this on Gingerbread. It passes all tests except
for testConnectViaHttpProxyToHttpsUsingProxySystemProperty, which
fails because of a bug in Gingerbread's java.net.ProxySelector.

This change introduces caching reflective objects for NPN access.
That'll make clients that make multiple SSL connections slightly
more efficient.
ghost pushed a commit that referenced this pull request Aug 2, 2012
@ghost ghost merged commit 434c4c6 into master Aug 2, 2012
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants