This is the mail archive of the cygwin-developers@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: [tolj@wapme-systems.de: Re: Problem with accept?!!


Corinna Vinschen wrote:
On Tue, Jun 03, 2003 at 03:35:08PM +0200, Thomas Pfaff wrote:

I have tried this one and it looks really good. The only thing i would change is that i would check except_fds instead of write_fds.


Yes, that makes sense to me.

Thanks for your detailed feedback!  I'm very happy with the result we
have now.  I've checked in the patch together with your change and
put our both names in the ChangeLog entry.  So people know they can
blame both of us for this patch ;-)


Before someone will notice this and try to blame us one more patch.
If a connect is interrupted subsequent calls to connect should fail and select must be used instead. With this patch EINPROGRESS (119) will be returned but i think that according to http://www.opengroup.org/onlinepubs/007904975/functions/connect.html
it should be EALREADY (120).


Thomas

--- net.cc.org	2003-06-03 15:24:06.000000000 +0200
+++ net.cc	2003-06-03 16:45:50.000000000 +0200
@@ -775,7 +775,7 @@ cygwin_connect (int fd, const struct soc
   else
     {
       bool was_blocking = false;
-      if (!fh->is_nonblocking ())
+      if (!fh->is_nonblocking () && !fh->is_connect_pending ())
         {
 	  int nonblocking = 1;
 	  fh->ioctl (FIONBIO, &nonblocking);
@@ -817,6 +817,7 @@ cygwin_connect (int fd, const struct soc
 	        {
 		  WSASetLastError (WSAEINPROGRESS);
 		  set_winsock_errno ();
+		  fh->set_connect_state (CONNECT_PENDING);
 		}
 	    }
 	  int nonblocking = 0;





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