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

Jack Moffitt jack at xiph.org
Fri Mar 22 13:24:57 PST 2002



jack        02/03/22 13:24:57

  Modified:    .        sock.c
  Log:
  Fix comments (and remove old commented out code) from sock_write_bytes.

Revision  Changes    Path
1.4       +2 -31     net/sock.c

Index: sock.c
===================================================================
RCS file: /usr/local/cvsroot/net/sock.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sock.c	2002/03/22 21:09:36	1.3
+++ sock.c	2002/03/22 21:24:57	1.4
@@ -193,16 +193,10 @@
 /* sock_write_bytes
 **
 ** write bytes to the socket
-** this function will block until all bytes are 
-** written, or there is an unrecoverable error
-** even if the socket is non-blocking
+** this function will _NOT_ block
 */
 int sock_write_bytes(sock_t sock, const char *buff, const int len)
 {
-//	int wrote, res, polled;
-	int res;
-//	struct pollfd socks;
-
         /* sanity check */
         if (!buff) {
                 return SOCK_ERROR;
@@ -211,31 +205,8 @@
         } else if (!sock_valid_socket(sock)) {
                 return SOCK_ERROR;
         }
-
-//	socks.fd = sock;
-//	socks.events = POLLOUT;
-
-//	wrote = 0;
-//	while (wrote < len) {
-//		polled = poll(&socks, 1, 30000);
-
-//		if ((polled == -1) && sock_recoverable(sock_error()))
-//			continue;
-//		if (polled != 1)
-//			return SOCK_ERROR;
-	
-//		res = send(sock, &buff[wrote], len - wrote, 0);
-		res = send(sock, buff, len, 0);
-//
-//		if ((res < 0) && (!sock_recoverable(sock_error())))
-//			return SOCK_ERROR;
-//		if (res > 0)
-//			wrote += res;
-//	}
-//
-//      return wrote;
 
-	return res;
+	return send(sock, buff, len, 0);
 }
 
 /* sock_write_string

<p><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