History log of /dalvik/libcore/luni/src/main/native/java_net_InetAddress.cpp
Revision Date Author Comments
7f4a5eccf19468e6ba8c132abc34e0670cc7cdfa 28-Jan-2010 Elliott Hughes <enh@google.com> Fix jniThrowRuntimeException for C callers, add jniThrowNullPointerException.

...and switch all NPE throwers over to the helper.
db0468516d1a4ce82698498b83eceac9ee96ea8a 16-Jan-2010 Elliott Hughes <enh@google.com> Rewrite InetAddress' DNS cache.

Replace harmony's two 5-element linked lists with a single 512-element
LinkedHashMap. Greatly reduce the time we spend under locks (and no network
I/O is done under a lock any more!). Take advantage of various properties
of how the cache is used to avoid having to do much explicit work to handle
expiry.

I've also optimized the usual no-SecurityManager/no custom system properties
configuring cache TTLs case (without making the slow path much slower than it
already was).

I've also updated the native method names to correspond to the C functions
they're really wrapping (rather than completely different IPv4-only ones
they probably used to wrap long ago).

I've also improved the InetAddress documentation.

Bug: 2320435
72e93344b4d1ffc71e9c832ec23de0657e5b04a5 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
60d3a548d07ce5161c91b50bb374b127ccec9b72 30-Sep-2009 Elliott Hughes <enh@google.com> Remove adb networking support from dalvik/libcore.

There's more to be removed from other projects, but this should probably
come out first.

Bug: 1122968
76ecf19c339da1f38a0e954ef39d9ff411b15925 01-Oct-2009 Elliott Hughes <enh@google.com> Use jniThrowException instead of FindClass/ThrowNew.

Always use our best-of-breed code for throwing exceptions. The remaining
callers of Throw have good reason, and the only caller of ThrowNew is
now JNIHelp.c (jniThrowException) itself.
b257c944e15c5be46a69143603426c7ce137e6a3 16-Sep-2009 Lorenzo Colitti <lorenzo@google.com> Report the cause of name lookup failures to Java land. The Java code already
uses the exception thrown by getallbyname() as a chained exception.

Change-Id: Ifc0d34102412ce0bf34715c9852bf751b420fb40
1ef5b44eaf9170686d28d564b8d247b3e22cb7ac 09-Sep-2009 Elliott Hughes <enh@google.com> Use Get*ArrayRegion/Set*ArrayRegion instead of Get*ArrayElements.

This fixes all instances in the networking code, but doesn't address similar
patterns, nor non-networking code. This seemed like a reasonably-sized
meaningful chunk. Tested on sapphire-eng.

Bug: 1639287
364a0a2faae81e5b0844685ad9272f090467db44 27-Aug-2009 Lorenzo Colitti <lorenzo@google.com> More InetAddress fixes.

1. Make sure getHostByAddrImpl actually throws UnknownHostException: set
NI_NAMEREQD when calling getnameinfo to ensure it will fail if the IP
address looked up does not have a name associated with it, and pass this
exception back to the Java code. That way, the UnknownHostException passed
back to the Java code has information on what went wrong.
2. Remove superfluous logging on reverse lookups in the C code.

Change-Id: Ie195ce1f12e7b43fbf75f494002804f9db68fd8c
fe79541b5cc5a490dd3a5b2e68f884fdfad4ca76 19-Aug-2009 Lorenzo Colitti <lorenzo@google.com> Enable IPv6.

If the system has IPv6 connectivity, query the DNS for IPv6 addresses as well
as IPv4 addresses. If IPv6 addresses are returned, prefer them by default.

Impact of this change:

- If the device is on a network with IPv6 configured, is using wifi, and has
obtained an IPv6 address using autoconfiguration, the network stack will
request IPv6 addresses as well as IPv4 addresses when making DNS queries. This
allows the device to connect to websites and services that declare themselves
to be reachable over IPv6. If an IPv6 connection fails, the stack will fall
back to IPv4. This is what Windows Vista, Mac OS 10.4 and above, and most
Linux distributions do by default.
- If the device is not on a network that supports IPv6, or is using 3G/EVDO,
nothing will change.

I have been testing this change on self-compiled builds of master and eclair on
Dream and Sholes for several weeks with no breakage that I can see.
593d6c7c4c08c82b361dcc08c20a0120aaaacf49 13-Jun-2009 Lorenzo Colitti <lorenzo@google.com> Copy the correct number of bytes for IPv6 addresses in InetAddress_gethostbyaddr
0d11781df02b2d7526d39ab045d417f98aaa5817 28-May-2009 Mike Lockwood <lockwood@android.com> InetAddress: Stop logging DNS lookups to logcat.

Logging all DNS lookups system wide raises privacy concerns to me
and might make people less likely to include logs in their bug reports.

Signed-off-by: Mike Lockwood <lockwood@android.com>
f2931ca22c6307a8740f2ec61795f7cfa6971262 27-Apr-2009 Urs Grob <ursg@google.com> Fix for excessive GREF use in gethostbyaddr.

Each call to gethostbyaddr in java_net_InetAddress.cpp increases the
GREF by one. After calling the method around 1800 times the vm
crashes because of excessive global references.
f6c387128427e121477c1b32ad35cdcaa5101ba3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
f72d5de56a522ac3be03873bdde26f23a5eeeb3c 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
077f9d75d9701778830742b9c2afad4742635b58 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
5d709784bbf5001012d7f25172927d46f6c1abe1 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
cc05ad238516f1303687aba4a978e24e57c0c07a 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
89c1feb0a69a7707b271086e749975b3f7acacf7 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
2ad60cfc28e14ee8f0bb038720836a4696c478ad 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution