svn commit: samba r7025 - in branches/SAMBA_3_0/source: lib tdb

Jeremy Allison jra at samba.org
Fri May 27 19:49:35 GMT 2005


On Fri, May 27, 2005 at 03:47:27PM -0400, derrell at samba.org wrote:
> 
> That's pretty much what my original patch did, except that it TRIED to avoid
> the overhead of calling read_socket_with_timeout() unless it got back EAGAIN,
> in which case the overhead was deemed to be worthwhile.
> 
> With my renewed insight into why I did things the way I did a few weeks ago,
> and your insight now about these additional details, maybe we should consider
> changing read_socket_data() to return partial packets if EAGAIN occurs after
> partial data has been read, and go back to my original patch?

No :-). As I said before, this breaks the contract for read_socket_data().

Try this instead. Much simpler.

Jeremy.
-------------- next part --------------
Index: lib/util_sock.c
===================================================================
--- lib/util_sock.c	(revision 7038)
+++ lib/util_sock.c	(working copy)
@@ -597,7 +597,12 @@
 	}
 
 	if(len > 0) {
-		ret = read_socket_data(fd,buffer+4,len);
+		if (timeout > 0) {
+			ret = read_socket_with_timeout(fd,buffer+4,len,len,timeout);
+		} else {
+			ret = read_socket_data(fd,buffer+4,len);
+		}
+
 		if (ret != len) {
 			if (smb_read_error == 0)
 				smb_read_error = READ_ERROR;


More information about the samba-cvs mailing list