Re: SocketPermission's implies() interesting behavior

2011-02-20 Thread Charles Lee
of java.net, i.e. openjdk.java.net -Chris. On 17/02/2011 09:19, Charles Lee wrote: Hi guys, I am reading the SocketPermission source code recently and find some thing strange. Below is a simple test case to describe the strange thing: SocketPermission star_All = new SocketPermission(&

Re: SocketPermission's implies() interesting behavior

2011-02-21 Thread Charles Lee
On 02/21/2011 09:57 PM, Chris Hegarty wrote: On 21/02/2011 02:36, Charles Lee wrote: : Thanks Chris. You have answer my first question. I have noticed that IP is important when we try to judge the imply. So it comes my other Yes, IP is very important. SocketPermission tries to resolve

Re: SocketPermission's implies() interesting behavior

2011-02-21 Thread Charles Lee
On 02/21/2011 09:57 PM, Chris Hegarty wrote: On 21/02/2011 02:36, Charles Lee wrote: : Thanks Chris. You have answer my first question. I have noticed that IP is important when we try to judge the imply. So it comes my other Yes, IP is very important. SocketPermission tries to resolve

Re: SocketPermission's implies() interesting behavior

2011-02-23 Thread Charles Lee
Thanks Chris. On 02/22/2011 05:43 PM, Chris Hegarty wrote: On 02/22/11 03:00 AM, Charles Lee wrote: : Hi, A quick patch could be: diff --git src/share/classes/java/net/SocketPermission.java src/share/classes/java/net/SocketPermission.java --- src/share/classes/java/net

Re: SocketPermission's implies() interesting behavior

2011-02-27 Thread Charles Lee
On 02/22/2011 05:43 PM, Chris Hegarty wrote: Hi Chris, any news for this issue? And where is CR 7021280? On 02/22/11 03:00 AM, Charles Lee wrote: : Hi, A quick patch could be: diff --git src/share/classes/java/net/SocketPermission.java src/share/classes/java/net/SocketPermission.java

Re: SocketPermission's implies() interesting behavior

2011-02-28 Thread Charles Lee
On 03/01/2011 02:40 AM, Alan Bateman wrote: Charles Lee wrote: On 02/22/2011 05:43 PM, Chris Hegarty wrote: Hi Chris, any news for this issue? And where is CR 7021280? I think there has been issues with bugs.sun.com recently and it's not keeping up. However this one is there:

URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

2011-03-01 Thread Charles Lee
Hi guys, With test case[1] below, you can see guessContent does not support UTF8/32 BOM. This problem could be solved with the patch[2]. The patch is straight forward: 1. read more bytes since UTF32 2. add xml type support in utf8 and utf32 BOM. [1] test case: public static void main(String[

Re: URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

2011-03-03 Thread Charles Lee
On 03/03/2011 12:48 AM, Alan Bateman wrote: Charles Lee wrote: Hi guys, With test case[1] below, you can see guessContent does not support UTF8/32 BOM. I don't see a problem with this proposal but I just wonder if this method is even used these days. It is a legacy method and I don

Re: URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

2011-03-06 Thread Charles Lee
On 03/04/2011 07:13 PM, Alan Bateman wrote: Charles Lee wrote: Hi Alan, Sorry for the late reply. This test case comes from a big test case, which test more types of stream. A test for this method should pass if "null" is returned as the method does not specify the content typ

Re: URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

2011-03-07 Thread Charles Lee
then maybe we should just proceed with getting it in. -Chris. On 07/03/2011 06:57, Charles Lee wrote: On 03/04/2011 07:13 PM, Alan Bateman wrote: Charles Lee wrote: Hi Alan, Sorry for the late reply. This test case comes from a big test case, which test more types of stream. A test for t

Re: SocketPermission's implies() interesting behavior

2011-03-09 Thread Charles Lee
On 03/10/2011 12:02 AM, Neil Richards wrote: On 1 March 2011 09:18, Chris Hegarty wrote: Michael, Can you please take a look at this change, CR 7021280: "SocketPermission trustProxy should accept wildcards". This patch came from Charles (cc'ed), and I agree with the changes. Can you please ta

Re: SocketPermission's implies() interesting behavior

2011-03-10 Thread Charles Lee
On 03/11/2011 02:33 AM, Neil Richards wrote: On 10 March 2011 03:18, Charles Lee wrote: With a quick search in the SocketPermission using "cname =" as search word, cname always seems to be lower cases. But hostname does not. It may need some rework on the patch. I t

Re: URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

2011-03-13 Thread Charles Lee
On 03/11/2011 07:14 PM, Chris Hegarty wrote: On 11/03/2011 05:13, Charles Lee wrote: On 03/10/2011 11:46 PM, Chris Hegarty wrote: Charles, Alan, I filed CR 7026346: " URLConnection.guessContentTypeFromStream does not support UTF-8 and UTF-32 xml streams with BOM", for this issu

Re: URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

2011-04-26 Thread Charles Lee
On 03/10/2011 11:46 PM, Chris Hegarty wrote: Charles, Alan, I filed CR 7026346: " URLConnection.guessContentTypeFromStream does not support UTF-8 and UTF-32 xml streams with BOM", for this issue. I also creating a webrev from your patch, with the following changes: * Moved the UTF-32BE befo

Re: SocketPermission's implies() interesting behavior

2011-07-05 Thread Charles Lee
On 04/08/2011 04:47 PM, Chris Hegarty wrote: On 04/ 7/11 04:53 PM, Neil Richards wrote: On Wed, 2011-03-16 at 10:43 +, Neil Richards wrote: On 11 March 2011 14:39, Chris Hegarty wrote: As Michael (cc'ed) mentioned in an earlier mail, he is going to be making some significant changes in t

Re: SocketPermission's implies() interesting behavior

2011-07-12 Thread Charles Lee
On 07/12/2011 07:03 PM, Chris Hegarty wrote: On 07/ 5/11 10:10 AM, Charles Lee wrote: On 04/08/2011 04:47 PM, Chris Hegarty wrote: On 04/ 7/11 04:53 PM, Neil Richards wrote: On Wed, 2011-03-16 at 10:43 +, Neil Richards wrote: On 11 March 2011 14:39, Chris Hegarty wrote: As Michael

Re: SocketPermission's implies() interesting behavior

2011-07-19 Thread Charles Lee
On 07/19/2011 04:00 PM, Chris Hegarty wrote: On 07/13/11 04:07 AM, Charles Lee wrote: On 07/12/2011 07:03 PM, Chris Hegarty wrote: On 07/ 5/11 10:10 AM, Charles Lee wrote: On 04/08/2011 04:47 PM, Chris Hegarty wrote: On 04/ 7/11 04:53 PM, Neil Richards wrote: On Wed, 2011-03-16 at 10:43

EHOSTUNREACH should not be considered as an exception when send on a loopback network interface.

2011-09-01 Thread Charles Lee
Hi guys, In some linuxes, when you bind on a loopback network interface, sendto will be fail and errono will be set to EHOSTUNREACH. In this situation, EHOSTUNREACH maybe need treat as INVAL: return false, not throw an exception. Patch is attached. Does anyone interested in this issue? --

Re: EHOSTUNREACH should not be considered as an exception when send on a loopback network interface.

2011-09-01 Thread Charles Lee
On 09/02/2011 12:50 PM, Charles Lee wrote: Hi guys, In some linuxes, when you bind on a loopback network interface, sendto will be fail and errono will be set to EHOSTUNREACH. In this situation, EHOSTUNREACH maybe need treat as INVAL: return false, not throw an exception. Patch is attached

Question about getaddrinfo in Inet4AddressImpl.c

2011-10-25 Thread Charles Lee
Hi guys, I am reading some native code in the jdk repos. I find that in Inet4AddressImpl.c (folder solaris), gethostbyname is used. Meanwhile in the Inet6AddressImpl.c. getaddrinfo is used. My question is why inet4 does not use getaddrinfo? Any concern here? There are some pros I can see if

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-10-26 Thread Charles Lee
On 10/25/2011 05:41 PM, Chris Hegarty wrote: On 10/25/11 08:31 AM, Charles Lee wrote: Hi guys, I am reading some native code in the jdk repos. I find that in Inet4AddressImpl.c (folder solaris), gethostbyname is used. Meanwhile in the Inet6AddressImpl.c. getaddrinfo is used. My question is

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-10-26 Thread Charles Lee
On 10/26/2011 04:30 PM, Alan Bateman wrote: On 26/10/2011 08:47, Charles Lee wrote: But I do not get getaddrinfo is ipv6 specified. Do I miss sth? If I recall correctly, when the support for IPv6 was added (predates OpenJDK as it was jdk1.4, as in 10 years ago) then getaddrinfo/getnameinfo

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-10-27 Thread Charles Lee
On 10/26/2011 05:36 PM, Alan Bateman wrote: On 26/10/2011 10:24, Charles Lee wrote: />>> I don't think this code has changed too much since then and probably could do with a clean-up./ Not true. I'm talking about the InetAddress* code, that hasn't changed signific

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-10-27 Thread Charles Lee
On 10/26/2011 06:31 PM, Chris Hegarty wrote: On 26/10/2011 10:36, Alan Bateman wrote: On 26/10/2011 10:24, Charles Lee wrote: />>> I don't think this code has changed too much since then and probably could do with a clean-up./ Not true. I'm talking about the InetAddress

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-02 Thread Charles Lee
On 10/26/2011 06:31 PM, Chris Hegarty wrote: On 26/10/2011 10:36, Alan Bateman wrote: On 26/10/2011 10:24, Charles Lee wrote: />>> I don't think this code has changed too much since then and probably could do with a clean-up./ Not true. I'm talking about the InetAddress

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-02 Thread Charles Lee
On 10/26/2011 06:31 PM, Chris Hegarty wrote: On 26/10/2011 10:36, Alan Bateman wrote: On 26/10/2011 10:24, Charles Lee wrote: />>> I don't think this code has changed too much since then and probably could do with a clean-up./ Not true. I'm talking about the InetAddress

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-06 Thread Charles Lee
On 11/03/2011 12:33 AM, Neil Richards wrote: On Wed, 2011-11-02 at 23:07 +0800, Charles Lee wrote: On 10/26/2011 06:31 PM, Chris Hegarty wrote: On 26/10/2011 10:36, Alan Bateman wrote: On 26/10/2011 10:24, Charles Lee wrote: />>> I don't think this code has changed too much

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-08 Thread Charles Lee
On 11/03/2011 12:33 AM, Neil Richards wrote: On Wed, 2011-11-02 at 23:07 +0800, Charles Lee wrote: On 10/26/2011 06:31 PM, Chris Hegarty wrote: On 26/10/2011 10:36, Alan Bateman wrote: On 26/10/2011 10:24, Charles Lee wrote: />>> I don't think this code has changed too much

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-08 Thread Charles Lee
On 11/09/2011 03:25 AM, Chris Hegarty wrote: Charles, Is it possible to fix up the style issues, etc that Neil pointed out, and have the webrev updated? Thanks, -Chris. On 11/ 8/11 01:44 PM, Charles Lee wrote: On 11/03/2011 12:33 AM, Neil Richards wrote: On Wed, 2011-11-02 at 23:07 +0800

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-13 Thread Charles Lee
+0800, Charles Lee wrote: On 11/09/2011 03:25 AM, Chris Hegarty wrote: Charles, Is it possible to fix up the style issues, etc that Neil pointed out, and have the webrev updated? Hi Chris, Here it is. (attached) And here it is, in webrev form [1]. Regards, Neil [1] http://cr.openjdk.jav

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-14 Thread Charles Lee
ssImpl.c", line 71: warning: declaration can not follow a statement If you have the time maybe you could resolve these? Thanks, -Chris. On 14/11/2011 05:41, Charles Lee wrote: On 11/12/2011 04:07 AM, Mike Duigou wrote: Some comments: Inet4AddressImpl.c: - why use bzero rather than posix

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-14 Thread Charles Lee
ssImpl.c", line 71: warning: declaration can not follow a statement If you have the time maybe you could resolve these? Thanks, -Chris. On 14/11/2011 05:41, Charles Lee wrote: On 11/12/2011 04:07 AM, Mike Duigou wrote: Some comments: Inet4AddressImpl.c: - why use bzero rather than posix

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-15 Thread Charles Lee
On 11/15/2011 07:10 PM, Chris Hegarty wrote: On 11/15/11 06:57 AM, Charles Lee wrote: Sigh. Chris, I still fail to see those warnings, even if I do a very clean remove of my build directory and rebuild the whole jdk The warning are being generated on Solaris when using the Sun

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-15 Thread Charles Lee
On 11/16/2011 01:00 AM, Neil Richards wrote: On Tue, 2011-11-15 at 19:37 +0800, Charles Lee wrote: On 11/15/2011 07:10 PM, Chris Hegarty wrote: On 11/15/11 06:57 AM, Charles Lee wrote: Sigh. Chris, I still fail to see those warnings, even if I do a very clean remove of my build directory

Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-16 Thread Charles Lee
On 11/17/2011 04:57 AM, Chris Hegarty wrote: On 11/16/11 01:48 AM, Charles Lee wrote: On 11/16/2011 01:00 AM, Neil Richards wrote: On Tue, 2011-11-15 at 19:37 +0800, Charles Lee wrote: On 11/15/2011 07:10 PM, Chris Hegarty wrote: On 11/15/11 06:57 AM, Charles Lee wrote: Sigh. Chris, I

InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-11-27 Thread Charles Lee
Hi guys, When we call InetAddress.getLocalHost(), we usually return the first entry of inet address array. The array keeps the same order as getaddrinfo gets (duplication has been removed). In Windows 2008 sp2 or later version Windows OS with multiple NICs, getaddrinfo() sorts the Addresses

Re: InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-11-28 Thread Charles Lee
On 11/28/2011 05:41 PM, Alan Bateman wrote: On 28/11/2011 06:52, Charles Lee wrote: Hi guys, When we call InetAddress.getLocalHost(), we usually return the first entry of inet address array. The array keeps the same order as getaddrinfo gets (duplication has been removed). In Windows 2008

Re: InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-11-30 Thread Charles Lee
Hi Alan, Sorry for the late reply. Please see below: On 11/29/2011 05:47 PM, Alan Bateman wrote: On 29/11/2011 02:11, Charles Lee wrote: You are right. The ipv4 will appear in front of ipv6, but the order of ipv4 or ipv6 (separately) will not be sorted. Right, but it means that if the host

Re: InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-12-01 Thread Charles Lee
On 12/01/2011 06:21 PM, Alan Bateman wrote: On 01/12/2011 01:13, Charles Lee wrote: Yes. In the customer scenario, the return value is 169.254.*.*/16 address. Sorry for all the questions but I'm still scratching my head as to how the lookup of the current host's name ends up with a

Re: InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-12-01 Thread Charles Lee
On 12/01/2011 06:46 PM, Chris Hegarty wrote: On 01/12/2011 10:21, Alan Bateman wrote: On 01/12/2011 01:13, Charles Lee wrote: Yes. In the customer scenario, the return value is 169.254.*.*/16 address. Sorry for all the questions but I'm still scratching my head as to how the lookup o

Re: InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-12-06 Thread Charles Lee
u are encountering this issue? What is the actual local system name? Is this name resolvable in the configured name service ( DNS ) ? Thanks, -Chris. On 12/ 2/11 07:45 AM, Charles Lee wrote: On 12/01/2011 06:46 PM, Chris Hegarty wrote: On 01/12/2011 10:21, Alan Bateman wrote: On 01/12/2011 01:13, Ch

Re: EHOSTUNREACH should not be considered as an exception when send on a loopback network interface.

2011-12-07 Thread Charles Lee
On 09/02/2011 12:58 PM, Charles Lee wrote: On 09/02/2011 12:50 PM, Charles Lee wrote: Hi guys, In some linuxes, when you bind on a loopback network interface, sendto will be fail and errono will be set to EHOSTUNREACH. In this situation, EHOSTUNREACH maybe need treat as INVAL: return false

Re: EHOSTUNREACH should not be considered as an exception when send on a loopback network interface.

2011-12-07 Thread Charles Lee
On 12/07/2011 09:39 PM, Chris Hegarty wrote: On 07/12/2011 11:12, Alan Bateman wrote: On 07/12/2011 08:11, Charles Lee wrote: : I'd like to raise this issue again. The patch is on the [1]: When a loopback network interface is bound to sendto and connect, in some linuxes it will thr

Re: InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-12-07 Thread Charles Lee
Hi Alan, On 12/07/2011 04:32 PM, Alan Bateman wrote: On 07/12/2011 06:58, Charles Lee wrote: Hi Chris, Sorry I can not give a *detailed* description :-P Have you successfully get an APIPA address? [1] is the link which describe they have get such addresses :-D The behaviour difference was

Re: EHOSTUNREACH should not be considered as an exception when send on a loopback network interface.

2011-12-12 Thread Charles Lee
On 12/12/2011 07:48 PM, Neil Richards wrote: On Thu, 2011-12-08 at 10:54 +, Chris Hegarty wrote: On 08/12/2011 03:16, Charles Lee wrote: Hi Alan, hi Chris, Thank you for reviewing this and creating a bug id for me. I have put a revised webrev at http://cr.openjdk.java.net/~littlee

Re: InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

2011-12-18 Thread Charles Lee
On 12/07/2011 04:32 PM, Alan Bateman wrote: On 07/12/2011 06:58, Charles Lee wrote: Hi Chris, Sorry I can not give a *detailed* description :-P Have you successfully get an APIPA address? [1] is the link which describe they have get such addresses :-D The behaviour difference was introduced

Give default value of O_NOFOLLOW if it is not defined

2011-12-27 Thread Charles Lee
Hi net and nio, I would like to propose a fix[1] which give the default value of O_NOFOLLOW if, one some platforms, O_NOFOLLOW is not defined. Would anyone help to review this fix? [1]: http://cr.openjdk.java.net/~littlee/OJDK-226/webrev.00/

Re: Java_java_net_Inet6AddressImpl_isReachable0 is returning false for InetAdress 0.0.0.0

2012-05-11 Thread Charles Lee
Hi Deven, The patch is committed @ Changeset: c5a07e3dca63 Author:youdwei Date: 2012-05-11 16:20 +0800 URL:http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c5a07e3dca63 7163874: InetAddress.isReachable should support pinging 0.0.0.0 Reviewed-by: alanb, chegar Please verify it and thank yo