svn commit: samba r2443 - in branches/SAMBA_4_0/source: libcli/raw librpc/rpc torture/rpc

metze at samba.org metze at samba.org
Mon Sep 20 10:40:11 GMT 2004


Author: metze
Date: 2004-09-20 10:40:11 +0000 (Mon, 20 Sep 2004)
New Revision: 2443

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2443&nolog=1

Log:
check return code of event_loop_once() to catch thet cases where the server
closes the connetion and we got EBADF from select() and event_loop_once() fails

metze

Modified:
   branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
   branches/SAMBA_4_0/source/torture/rpc/echo.c
   branches/SAMBA_4_0/source/torture/rpc/netlogon.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawrequest.c	2004-09-20 10:29:13 UTC (rev 2442)
+++ branches/SAMBA_4_0/source/libcli/raw/rawrequest.c	2004-09-20 10:40:11 UTC (rev 2443)
@@ -285,7 +285,9 @@
 
 	/* keep receiving packets until this one is replied to */
 	while (req->state <= SMBCLI_REQUEST_RECV) {
-		event_loop_once(req->transport->event.ctx);
+		if (event_loop_once(req->transport->event.ctx) != 0) {
+			return False;
+		}
 	}
 
 	return req->state == SMBCLI_REQUEST_DONE;

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2004-09-20 10:29:13 UTC (rev 2442)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2004-09-20 10:40:11 UTC (rev 2443)
@@ -436,7 +436,9 @@
 
 	while (NT_STATUS_IS_OK(state->status) && state->reply_blob) {
 		struct event_context *ctx = p->transport.event_context(p);
-		event_loop_once(ctx);
+		if (event_loop_once(ctx) != 0) {
+			return NT_STATUS_CONNECTION_DISCONNECTED;
+		}
 	}
 
 	return state->status;
@@ -882,7 +884,9 @@
 
 	while (req->state == RPC_REQUEST_PENDING) {
 		struct event_context *ctx = dcerpc_event_context(req->p);
-		event_loop_once(ctx);
+		if (event_loop_once(ctx) != 0) {
+			return NT_STATUS_CONNECTION_DISCONNECTED;
+		}
 	}
 	*stub_data = req->payload;
 	status = req->status;

Modified: branches/SAMBA_4_0/source/torture/rpc/echo.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/echo.c	2004-09-20 10:29:13 UTC (rev 2442)
+++ branches/SAMBA_4_0/source/torture/rpc/echo.c	2004-09-20 10:40:11 UTC (rev 2443)
@@ -237,7 +237,9 @@
 
 	ctx = dcerpc_event_context(p);
 	while (total_done < ASYNC_COUNT) {
-		event_loop_once(ctx);
+		if (event_loop_once(ctx) != 0) {
+			return False;
+		}
 		for (i=0;i<ASYNC_COUNT;i++) {
 			if (done[i] == 0 && req[i]->state == RPC_REQUEST_DONE) {
 				total_done++;

Modified: branches/SAMBA_4_0/source/torture/rpc/netlogon.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/netlogon.c	2004-09-20 10:29:13 UTC (rev 2442)
+++ branches/SAMBA_4_0/source/torture/rpc/netlogon.c	2004-09-20 10:40:11 UTC (rev 2443)
@@ -1706,7 +1706,9 @@
 
 		/* even with this flush per request a w2k3 server seems to 
 		   clag with multiple outstanding requests. bleergh. */
-		event_loop_once(dcerpc_event_context(p));
+		if (event_loop_once(dcerpc_event_context(p)) != 0) {
+			return False;
+		}
 	}
 
 	for (i=0;i<ASYNC_COUNT;i++) {



More information about the samba-cvs mailing list