[xiph-cvs] cvs commit: net sock.c

Karl Heyes karl at xiph.org
Tue Feb 17 06:17:59 PST 2004



karl        04/02/17 09:17:59

  Modified:    .        sock.c
  Log:
  handle error condition at connection

Revision  Changes    Path
1.38      +8 -5      net/sock.c

Index: sock.c
===================================================================
RCS file: /usr/local/cvsroot/net/sock.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- sock.c	12 Feb 2004 21:28:35 -0000	1.37
+++ sock.c	17 Feb 2004 14:17:57 -0000	1.38
@@ -448,11 +448,12 @@
     }
 }
 
-/* see if a connection can be written to
-** return -1 for failure
-** return 0 for not yet
-** return 1 for ok 
-*/
+/* see if a connection has been established
+ * return SOCK_TIMEOUT for timeout
+ * return SOCK_ERROR for failure
+ * return 0 for try again, interrupted
+ * return 1 for ok 
+ */
 int sock_connected (int sock, unsigned timeout)
 {
     fd_set wfds;
@@ -480,7 +481,9 @@
             {
                 if (val == 0)
                     return 1;
+                sock_set_error (val);
             }
+            /* fall through */
         case -1:
             if (sock_recoverable (sock_error()))
                 return 0;

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list