summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use the IPv6 instead of the IPv4 wildcard address in sockets.Lorenzo Colitti2015-01-226-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few places in libcore consider the local address of an unbound socket to be Inet4Address.ANY. For example, calling getLocalAddress on an uncreated Socket will return 0.0.0.0, and when creating a DatagramSocket, libcore attempts to bind it to 0.0.0.0 unless the caller specifies another address. On Android, this is incorrect. All native socket filedescriptors that underpin Java socket objects are created by IoBridge.socket, and are dual-stack AF_INET6 sockets, not AF_INET sockets. When such a socket is created, its local address is ::, not 0.0.0.0. Thus, for example, calling getLocalAddress on a just-created ServerSocket object will return ::. Binding to 0.0.0.0 is not even allowed by os.bind, which silently converts it to :: instead (in inetAddresstoSockaddr). Therefore, accept reality and use :: instead of 0.0.0.0 in the Java layer as well. Specifically: 1. Change DatagramSocket's constructors to bind to :: instead of 0.0.0.0. This is a complete no-op, because os.bind() silently converts 0.0.0.0 into ::. Add a test for the other of the two codepaths. 2. Change InetSocketAddress so that an uninitialized object has an IP address of :: and not 0.0.0.0, and update its test. This is unlikely to break anything short of an app that explicitly depends on this behaviour, because os.bind() converts 0.0.0.0 to ::, and because any SocketAddress returned by any real socket will never contain 0.0.0.0 anyway. 3. Change Socket so that calling getLocalAddress() when there is no underlying socket file descriptor is will return :: instead of 0.0.0.0. This is more correct, because it's consistent with sockets that have been created, which will never have a local address of 0.0.0.0. Tested: vogar $(find libcore/*Socket*Test*) all passes on device. Bug: 18094870 Change-Id: I9d60710fe945a99d6a5e65430248a889008ef4b1
* Merge "Get rid of rule to generate a file with a # in its name."Narayan Kamath2015-01-212-20/+0
|\
| * Get rid of rule to generate a file with a # in its name.Narayan Kamath2015-01-212-20/+0
|/ | | | | | | | | Was only around to work around perforce issues, and we have a copy of this file checked in anyway. Also, gets rid of an unused constant referencing the name. Change-Id: Iddd5871130d779455f8ff960703945dc1d745e18
* Merge "Fix ProcessTest#getErrorStream."Narayan Kamath2015-01-211-1/+1
|\
| * Fix ProcessTest#getErrorStream.Narayan Kamath2015-01-211-1/+1
| | | | | | | | | | | | | | | | Broken by the move to toybox. Instead of double guessing the error message, just assume that all "cat" variants (host / target etc.) output the name of the "bad" paramater to the error stream. Change-Id: If19fa737e0d3a3dd023185fa23854da3022020fa
* | Merge "Clarify comment on private method."Narayan Kamath2015-01-211-1/+3
|\ \ | |/ |/|
| * Clarify comment on private method.Narayan Kamath2015-01-201-1/+3
|/ | | | | | Make it clear that it's called from native code. Change-Id: Ia44ba6fe70b6cbb559921553f3b137fd3bb0df2b
* Merge "Add a unit test to demonstrate ICU CharsetProvider problems"Narayan Kamath2015-01-205-36/+141
|\
| * Add a unit test to demonstrate ICU CharsetProvider problemsNarayan Kamath2015-01-205-36/+141
| | | | | | | | | | | | | | | | Also add a single FakeCharsetProvider for unit tests that does nothing by default, so that we can stub it in for tests that do care about it and none of our other tests are affected. Change-Id: I03abb8f1aff53c160935b4cdbeaef764d30f240a
* | Merge "Make socket binding behavior clearer"Neil Fuller2015-01-205-46/+40
|\ \
| * | Make socket binding behavior clearerNeil Fuller2015-01-205-46/+40
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Use of "localhost" to mean "the local host" and not "loopback" was confusing. Some docs lacked information. InetSocketAddress was ambiguous around what was being described. Use of "this socket" rather than "the socket [endpoint|address|]" makes it sound like InetSocketAddress is a socket, not a socket's address. Bug: 19065543 Change-Id: Ic7265464ba39ecace6640b8c4f7a9084ea6ae1d2
* | Merge "Changes needed to support OkHttp upgrade"Neil Fuller2015-01-202-42/+7
|\ \
| * | Changes needed to support OkHttp upgradeNeil Fuller2015-01-202-42/+7
| | | | | | | | | | | | Change-Id: Ifd6ed8ab22e7fd5d8cb8c9eb28976291d125c0e4
* | | Merge "Remove fcntlLong, use fcntlInt for F_SETFD instead."Narayan Kamath2015-01-206-11/+1
|\ \ \ | |_|/ |/| |
| * | Remove fcntlLong, use fcntlInt for F_SETFD instead.Narayan Kamath2015-01-196-11/+1
|/ / | | | | | | | | | | | | | | | | | | fcntlLong works too, but only because of the syscall conventions happen to place the lower 32 bits of our jlong in the right register. This change also gets rid of fcntlLong because there aren't any documented fcntl calls that take a 64 bit integer argument. Change-Id: I8d187d5b906195fc663675a07a5f116dcd210d16
* | Merge "Add fcntlInt."Narayan Kamath2015-01-196-20/+44
|\ \
| * | Add fcntlInt.Narayan Kamath2015-01-166-20/+44
| | | | | | | | | | | | | | | | | | Hidden for now, for use from the frameworks. Change-Id: I30d95b28ecbc422aaa5bf28fb2f288c3ca026493
* | | Merge "Only bother building the host tests for Linux."Elliott Hughes2015-01-161-0/+4
|\ \ \
| * | | Only bother building the host tests for Linux.Elliott Hughes2015-01-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | It's the only place you can run the host tests anyway. Change-Id: I5fe2b5b74e70a17696baf8ceaacaf4fca52d71ca
* | | | Merge "Add a warning about relative paths to ZipEntry#getName."Narayan Kamath2015-01-161-0/+5
|\ \ \ \
| * | | | Add a warning about relative paths to ZipEntry#getName.Narayan Kamath2015-01-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | bug: 18644314 Change-Id: I62e94208392a5f22130ff603bfd1f2f9ec9ef81d
* | | | | Merge "Cache class and field lookups in StrictJarFile."Narayan Kamath2015-01-161-5/+7
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Cache class and field lookups in StrictJarFile.Narayan Kamath2015-01-081-5/+7
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Iterating over a list of ZipEntries might otherwise do more work than necessary and create unnecessary garbage. Also, this is the idiom for such JNI code. Change-Id: I869289a32e0822bab9ca0345cdc3fc5aaa8adc7e
* | | | Merge "Revert "Introduce user.locale.""Narayan Kamath2015-01-163-57/+8
|\ \ \ \
| * | | | Revert "Introduce user.locale."Narayan Kamath2015-01-163-57/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7f6e083f86b711bf905edbf1932f6b35877f9d92. Breaks an art test, not sure why. Change-Id: Idbdb03b6e038b73ac07cf3343ff7ddd123d06d01
* | | | | Merge "Introduce user.locale."Narayan Kamath2015-01-163-8/+57
|\ \ \ \ \ | |/ / / /
| * | | | Introduce user.locale.Narayan Kamath2015-01-153-8/+57
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Behaves similar to {user.language, user.country} but is a BCP-47 tag that's parsed with Locale.forLanguageTag. bug: 17691569 Change-Id: I7846a284cdd083233129f9adc0886098ee2ffbb8
* | | | Merge "Fix confusing Selector docs"Neil Fuller2015-01-141-5/+10
|\ \ \ \
| * | | | Fix confusing Selector docsNeil Fuller2015-01-141-5/+10
| | |_|/ | |/| | | | | | | | | | Change-Id: Ifb2139c49a071dcf2e28e8df54e355321508f4db
* | | | Merge "Fix the hostname for the IPv6 loopback address"Neil Fuller2015-01-145-18/+88
|\ \ \ \ | |/ / / |/| | |
| * | | Fix the hostname for the IPv6 loopback addressNeil Fuller2015-01-145-18/+88
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the hostname was "localhost", which resolves to the IPv4 loopback address. Also fixed the documentation for getAllByName(null) which has returned the loopback addresses all the way back to 2009 and not thrown an exception as suggested in the docs. Test fixes and new tests included. Depends on commit 25147416bb105914c3cdf8fd65ca7cc20dae0f3e Bug: 18991397 Bug: https://code.google.com/p/android/issues/detail?id=96801 Change-Id: I9723516a977e2a3b97412bc1d7e58b36df327feb
* | | Merge "Increase ThreadTest tolerance"Mathieu Chartier2015-01-131-3/+3
|\ \ \ | |/ / |/| |
| * | Increase ThreadTest toleranceMathieu Chartier2015-01-131-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Aims to fix flaky test. Decreased minimum from 90% to 80%. Increased maximum from 110% to 120%. Increased maximum waitMillis from 10ms to 30ms. Bug: 18788389 (cherry picked from commit 0311cd2be856e4c5872ebbe5ac7e12eac334ad73) Change-Id: Ie3d84cf71769208e851b9fa7587c62858efdf4dd
* | Merge "More FileDescriptor.isSocket cleanup."Elliott Hughes2015-01-093-5/+5
|\ \
| * | More FileDescriptor.isSocket cleanup.Elliott Hughes2015-01-083-5/+5
|/ / | | | | | | | | | | | | | | | | | | Rename isSocket to isSocket$ since it's public @hide. Make isSocket$ final, even though the class is final, so it's obvious from grep that you can't accidentally override this. (The other public @hide methods in this class were already explicitly marked final.) Change-Id: I90563ca567857fa7d38b7ee8006f8abe6ca2db9a
* | Merge "Add VMRuntime.clampGrowthLimit"Mathieu Chartier2015-01-091-0/+6
|\ \
| * | Add VMRuntime.clampGrowthLimitMathieu Chartier2015-01-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Used to release virtual memory for apps with small heaps according to manifest. Bug: 18387825 Bug: 17131630 Change-Id: I73cf18c80e7ce76bd627e5a9439dec4277c6af2d
* | | Merge "Fix and clean up FileDescriptor.isSocket."Elliott Hughes2015-01-082-7/+22
|\ \ \
| * | | Fix and clean up FileDescriptor.isSocket.Elliott Hughes2015-01-082-7/+22
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original logic was accidentally inverted. This prevented sockets from being untagged, which would result in cancelled requests stalling out with sub-optimal TCP ZeroWindow detection instead of sending RST packets. Add a comment explaining how this works. Switch from SO_ERROR (which has a side-effect) to SO_DEBUG (which doesn't). Add a unit test. Bug: 18706592 Change-Id: Ib822a9727668908e04f87a6deb104dcebf333f05
* | | Merge "SSLSocketTest: test close alert during handshake"Kenny Root2015-01-081-0/+148
|\ \ \ | |/ / |/| |
| * | SSLSocketTest: test close alert during handshakeKenny Root2015-01-081-0/+148
|/ / | | | | | | | | | | | | | | If a client/server gets a close alert during a handshake, it should give a sane error message instead of something that is confusing to the developer. Bug: 18758595 Change-Id: I5d8d7dcb74fed4ff0ab943b5dc666819ec076e31
* | Merge "Add a test for bug 18644314."Narayan Kamath2015-01-081-9/+48
|\ \
| * | Add a test for bug 18644314.Narayan Kamath2015-01-081-9/+48
| | | | | | | | | | | | | | | bug: 18644314 Change-Id: I7eaf8f636c22e6c429af0686e3445eae3cd00d96
* | | Merge "SSLEngineTest: position should be same as produced/consumed"Kenny Root2015-01-081-3/+11
|\ \ \
| * | | SSLEngineTest: position should be same as produced/consumedKenny Root2015-01-071-3/+11
|/ / / | | | | | | | | | | | | | | | | | | | | | The position of the buffer should match the number of bytes produced or consumed. Make sure all the tests have this condition on the handshake. Bug: 18921387 Change-Id: I8d248b2ac189d801586510fb5aca2e3bd6701ffe
* | | Merge "Fix a javadoc typo in java.net.URL.equals."Elliott Hughes2015-01-071-1/+1
|\ \ \
| * | | Fix a javadoc typo in java.net.URL.equals.Elliott Hughes2015-01-061-1/+1
| | |/ | |/| | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=92930 Change-Id: Id3bc22d16cf4f493e937ebc76ebacd6a01b6f454
* | | Merge "Make some hidden methods final and more obviously private"Neil Fuller2015-01-072-7/+7
|\ \ \ | |/ / |/| |
| * | Make some hidden methods final and more obviously privateNeil Fuller2015-01-072-7/+7
| |/ | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=93714 Change-Id: I986c6af2bf8c54de06c95b2fd0d53709a7c9d573
* | Merge "Avoid a type conversion during comparison"Neil Fuller2015-01-061-1/+1
|\ \ | |/ |/|