This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SSH -R problem


On Mon, Apr 29, 2002 at 08:58:09PM -0400, Pierre A. Humblet wrote:
> 2) The reason the sockets persist is that they are 
> non-blocking. On Win95/98/ME close() doesn't work 
> correctly for non-blocking sockets, as reported in
> http://cygwin.com/ml/cygwin-patches/2002-q2/msg00095.html 
> 
> The patch in fhandler_socket::close() would be something like:
> /* HACK */
> If the socket is non blocking
>   then make it blocking 
>        set linger to Off 
>          (which will make close() non-blocking, as desired)
>   else set linger to On, as done currently
> The WSAEWOULDBLOCK stuff could go away.
> 
> I don't have the time to test and submit a real patch for the 
> moment, perhaps Steve could help.
> My rough test code basically adds
>  int request = 0;
>  ioctl (FIONBIO, &request);
>  linger.l_onoff = 0; 
> I have made > 500 calls into a connection created by ssh -R 
> from WinME to WinME and > 100 calls into ssh -L from a client 
> on WinME to a server on Win98. 

I think it's worth a try.  I'll probably check in something
similar to the above hack but...

> Of course we are then exposed to the issue that Cygwin was trying
> to fix by setting linger to On, i.e. the case of a process 
> exiting just after the close(). Fortunately sockets are usually 

...why cant we keep that, i. e.

   If the socket is non blocking
     then make it blocking
    set linger to On, as done currently

?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]