# HG changeset patch # User wetmore # Date 1219677068 25200 # Node ID 933749609149a7cbd0ab1e293197295fbf4b4ab5 # Parent 5a73ac754ac709f1a1d552ac04ad0aa97cf45269# Parent af4930f761df3f570b6ac4625d112b42ff309eea Merge diff -r 5a73ac754ac7 -r 933749609149 jdk/make/java/net/mapfile-vers --- a/jdk/make/java/net/mapfile-vers Fri Aug 22 22:54:20 2008 -0700 +++ b/jdk/make/java/net/mapfile-vers Mon Aug 25 08:11:08 2008 -0700 @@ -57,7 +57,7 @@ Java_java_net_Inet6AddressImpl_isReachable0; Java_java_net_NetworkInterface_init; Java_java_net_NetworkInterface_getByName0; - Java_java_net_NetworkInterface_getByIndex; + Java_java_net_NetworkInterface_getByIndex0; Java_java_net_NetworkInterface_getByInetAddress0; Java_java_net_NetworkInterface_getAll; Java_java_net_NetworkInterface_isUp0; diff -r 5a73ac754ac7 -r 933749609149 jdk/src/share/classes/java/net/NetworkInterface.java --- a/jdk/src/share/classes/java/net/NetworkInterface.java Fri Aug 22 22:54:20 2008 -0700 +++ b/jdk/src/share/classes/java/net/NetworkInterface.java Mon Aug 25 08:11:08 2008 -0700 @@ -203,11 +203,17 @@ } /** - * Get the index of this network interface. + * Returns the index of this network interface. The index is an integer greater + * or equal to zero, or {@code -1} for unknown. This is a system specific value + * and interfaces with the same name can have different indexes on different + * machines. * - * @return the index of this network interface + * @return the index of this network interface or {@code -1} if the index is + * unknown + * @see #getByIndex(int) + * @since 1.7 */ - int getIndex() { + public int getIndex() { return index; } @@ -249,11 +255,18 @@ * Get a network interface given its index. * * @param index an integer, the index of the interface - * @return the NetworkInterface obtained from its index - * @exception SocketException if an I/O error occurs. + * @return the NetworkInterface obtained from its index, or {@code null} if + * there is no interface with such an index on the system + * @throws SocketException if an I/O error occurs. + * @throws IllegalArgumentException if index has a negative value + * @see #getIndex() + * @since 1.7 */ - native static NetworkInterface getByIndex(int index) - throws SocketException; + public static NetworkInterface getByIndex(int index) throws SocketException { + if (index < 0) + throw new IllegalArgumentException("Interface index can't be negative"); + return getByIndex0(index); + } /** * Convenience method to search for a network interface that @@ -325,6 +338,9 @@ private native static NetworkInterface getByName0(String name) throws SocketException; + private native static NetworkInterface getByIndex0(int index) + throws SocketException; + private native static NetworkInterface getByInetAddress0(InetAddress addr) throws SocketException; diff -r 5a73ac754ac7 -r 933749609149 jdk/src/share/classes/java/net/ServerSocket.java --- a/jdk/src/share/classes/java/net/ServerSocket.java Fri Aug 22 22:54:20 2008 -0700 +++ b/jdk/src/share/classes/java/net/ServerSocket.java Mon Aug 25 08:11:08 2008 -0700 @@ -142,14 +142,18 @@ * as its argument to ensure the operation is allowed. * This could result in a SecurityException. * - *
The backlog
argument must be a positive
- * value greater than 0. If the value passed is equal or less
- * than 0, then the default value will be assumed.
+ * The backlog
argument is the requested maximum number of
+ * pending connections on the socket. Its exact semantics are implementation
+ * specific. In particular, an implementation may impose a maximum length
+ * or may choose to ignore the parameter altogther. The value provided
+ * should be greater than 0
. If it is less than or equal to
+ * 0
, then an implementation specific default will be used.
*
*
* @param port the port number, or 0
to use a port
* number that is automatically allocated.
- * @param backlog the maximum length of the queue.
+ * @param backlog requested maximum length of the queue of incoming
+ * connections.
*
* @exception IOException if an I/O error occurs when opening the socket.
* @exception SecurityException
@@ -187,13 +191,17 @@
* as its argument to ensure the operation is allowed.
* This could result in a SecurityException.
*
- *
The backlog
argument must be a positive
- * value greater than 0. If the value passed is equal or less
- * than 0, then the default value will be assumed.
+ * The backlog
argument is the requested maximum number of
+ * pending connections on the socket. Its exact semantics are implementation
+ * specific. In particular, an implementation may impose a maximum length
+ * or may choose to ignore the parameter altogther. The value provided
+ * should be greater than 0
. If it is less than or equal to
+ * 0
, then an implementation specific default will be used.
*
* @param port the port number, or 0
to use a port
* number that is automatically allocated.
- * @param backlog the listen backlog
+ * @param backlog requested maximum length of the queue of incoming
+ * connections.
* @param bindAddr the local InetAddress the server will bind to
*
* @throws SecurityException if a security manager exists and
@@ -321,11 +329,15 @@
* If the address is null
, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
*
- * The backlog
argument must be a positive
- * value greater than 0. If the value passed is equal or less
- * than 0, then the default value will be assumed.
+ * The backlog
argument is the requested maximum number of
+ * pending connections on the socket. Its exact semantics are implementation
+ * specific. In particular, an implementation may impose a maximum length
+ * or may choose to ignore the parameter altogther. The value provided
+ * should be greater than 0
. If it is less than or equal to
+ * 0
, then an implementation specific default will be used.
* @param endpoint The IP address & port number to bind to.
- * @param backlog The listen backlog length.
+ * @param backlog requested maximum length of the queue of
+ * incoming connections.
* @throws IOException if the bind operation fails, or if the socket
* is already bound.
* @throws SecurityException if a SecurityManager
is present and
diff -r 5a73ac754ac7 -r 933749609149 jdk/src/share/classes/javax/net/ssl/SSLServerSocket.java
--- a/jdk/src/share/classes/javax/net/ssl/SSLServerSocket.java Fri Aug 22 22:54:20 2008 -0700
+++ b/jdk/src/share/classes/javax/net/ssl/SSLServerSocket.java Mon Aug 25 08:11:08 2008 -0700
@@ -108,9 +108,12 @@
*
* A port number of 0
creates a socket on any free port.
*
- * The backlog
argument must be a positive
- * value greater than 0. If the value passed if equal or less
- * than 0, then the default value will be assumed.
+ * The backlog
argument is the requested maximum number of
+ * pending connections on the socket. Its exact semantics are implementation
+ * specific. In particular, an implementation may impose a maximum length
+ * or may choose to ignore the parameter altogther. The value provided
+ * should be greater than 0
. If it is less than or equal to
+ * 0
, then an implementation specific default will be used.
*
* If there is a security manager, its checkListen
* method is called with the port
argument as its
@@ -118,8 +121,8 @@
* in a SecurityException.
*
* @param port the port on which to listen
- * @param backlog how many connections may be pending before
- * the system should start rejecting new requests
+ * @param backlog requested maximum length of the queue of incoming
+ * connections.
* @throws IOException if an I/O error occurs when creating the socket
* @throws SecurityException if a security manager exists and its
* checkListen
method doesn't allow the operation.
@@ -150,16 +153,19 @@
*
* A port number of 0
creates a socket on any free port.
*
- *
The backlog
argument must be a positive
- * value greater than 0. If the value passed if equal or less
- * than 0, then the default value will be assumed.
+ * The backlog
argument is the requested maximum number of
+ * pending connections on the socket. Its exact semantics are implementation
+ * specific. In particular, an implementation may impose a maximum length
+ * or may choose to ignore the parameter altogther. The value provided
+ * should be greater than 0
. If it is less than or equal to
+ * 0
, then an implementation specific default will be used.
*
* If address is null, it will default accepting connections * on any/all local addresses. * * @param port the port on which to listen - * @param backlog how many connections may be pending before - * the system should start rejecting new requests + * @param backlog requested maximum length of the queue of incoming + * connections. * @param address the address of the network interface through * which connections will be accepted * @throws IOException if an I/O error occurs when creating the socket diff -r 5a73ac754ac7 -r 933749609149 jdk/src/share/classes/sun/security/util/DerIndefLenConverter.java --- a/jdk/src/share/classes/sun/security/util/DerIndefLenConverter.java Fri Aug 22 22:54:20 2008 -0700 +++ b/jdk/src/share/classes/sun/security/util/DerIndefLenConverter.java Mon Aug 25 08:11:08 2008 -0700 @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,6 +50,7 @@ private byte[] data, newData; private int newDataPos, dataPos, dataSize, index; + private int unresolved = 0; private ArrayList