Browse code

- fix: signed/unsigned comparisons (tcp_send)

Andrei Pelinescu-Onciul authored on 22/12/2007 18:13:29
Showing 2 changed files
... ...
@@ -1596,7 +1596,7 @@ no_id:
1596 1596
 				 * desired either lock before the write or use 
1597 1597
 				 * _wbufq_insert(...) */
1598 1598
 				n=_tcpconn_write_nb(fd, c, buf, len);
1599
-				if (unlikely(n<len)){
1599
+				if (unlikely(n<(int)len)){
1600 1600
 					if ((n>=0) || errno==EAGAIN || errno==EWOULDBLOCK){
1601 1601
 						DBG("tcp_send: pending write on new connection %p "
1602 1602
 								" (%d/%d bytes written)\n", c, n, len);
... ...
@@ -1789,7 +1789,7 @@ send_it:
1789 1789
 	
1790 1790
 	DBG("tcp_send: after real write: c= %p n=%d fd=%d\n",c, n, fd);
1791 1791
 	DBG("tcp_send: buf=\n%.*s\n", (int)len, buf);
1792
-	if (unlikely(n<len)){
1792
+	if (unlikely(n<(int)len)){
1793 1793
 #ifdef TCP_BUF_WRITE
1794 1794
 		if (tcp_options.tcp_buf_write && 
1795 1795
 				((n>=0) || errno==EAGAIN || errno==EWOULDBLOCK)){
... ...
@@ -129,7 +129,7 @@ again:
129 129
 		);
130 130
 	TSEND_ERR_CHECK("tsend_stream");
131 131
 	written+=n; 
132
-	if (n<len){ 
132
+	if (n<(int)len){ 
133 133
 		/* partial write */ 
134 134
 		buf+=n; 
135 135
 		len-=n;