[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-java
Subject:    Re: [PATCH] jdk1.4.2, getsockname(), and ECONNRESET
From:       Greg Lewis <glewis () eyesbeyond ! com>
Date:       2005-06-21 21:01:25
Message-ID: 20050621210125.GA96069 () misty ! eyesbeyond ! com
[Download RAW message or body]

Hi Landon,

On Tue, Jun 21, 2005 at 11:33:09AM -0700, Landon Fuller wrote:
> In j2se/src/solaris/native/sun/nio/ch/Net.c, getsockname() is called to 
> determine the local address and port of a socket.
> 
> Under both Linux and Solaris, getsockname() will only fail if invalid 
> arguments are provided. If getsockname() returns an error, Java throws 
> a java.lang.Error.
> On FreeBSD, getsockname() will also return an error with errno set to 
> ECONNRESET if the connection has been reset by the peer. Consequently, 
> Java throws a java.lang.Error.
> 
> The only way to handle this without an API change is to check for 
> ECONNRESET; In the attached patch, if errno is set to?ECONNRESET we 
> fill in the sockaddr structure with a port of 0, an IP of INADDR_ANY, 
> and clear out the error.

On Linux and/or Solaris, what happens when you call getsockname() on a
socket that has had the connection reset by the peer?  In particular,
is it compatible with what your patch does or are we introducing a new
scenario that the socket code for applications must handle?

> Also, any comments on the thread-safe resolver patch?

My bad, I haven't gotten to testing it yet :(.  One concern was that
you mention the routines you're using are thread safe under 5.4 and
better and I wondered if there was an impact on 4.x users?  I will
try and get this tested soon, as I want it in the next patchset.

-- 
Greg Lewis                          Email   : glewis@eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis@FreeBSD.org
_______________________________________________
freebsd-java@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic