svn commit: samba r7653 - in branches/SAMBA_4_0/source/librpc/rpc: .

tridge at samba.org tridge at samba.org
Thu Jun 16 23:02:40 GMT 2005


Author: tridge
Date: 2005-06-16 23:02:40 +0000 (Thu, 16 Jun 2005)
New Revision: 7653

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7653

Log:
when a dcerpc request times out, we need to ensure that if the server
does finally answer the request and it is on the smb transport that we
don't die in the callback code as the rpc request state is gone.

Modified:
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2005-06-16 23:01:42 UTC (rev 7652)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2005-06-16 23:02:40 UTC (rev 7653)
@@ -513,6 +513,7 @@
   hold the state of pending full requests
 */
 struct full_request_state {
+	struct dcerpc_connection *c;
 	DATA_BLOB *reply_blob;
 	NTSTATUS status;
 };
@@ -523,7 +524,12 @@
 static void full_request_recv(struct dcerpc_connection *c, DATA_BLOB *blob, 
 			      NTSTATUS status)
 {
-	struct full_request_state *state = c->full_request_private;
+	struct full_request_state *state = talloc_get_type(c->full_request_private,
+							   struct full_request_state);
+	if (state == NULL) {
+		/* it timed out earlier */
+		return;
+	}
 
 	if (!NT_STATUS_IS_OK(status)) {
 		state->status = status;
@@ -542,6 +548,7 @@
 	struct full_request_state *state = talloc_get_type(private, 
 							   struct full_request_state);
 	state->status = NT_STATUS_IO_TIMEOUT;
+	state->c->full_request_private = NULL;
 }
 
 /*
@@ -562,6 +569,7 @@
 
 	state->reply_blob = reply_blob;
 	state->status = NT_STATUS_OK;
+	state->c = c;
 
 	c->transport.recv_data = full_request_recv;
 	c->full_request_private = state;
@@ -581,6 +589,8 @@
 		}
 	}
 
+	c->full_request_private = NULL;
+
 	return state->status;
 }
 



More information about the samba-cvs mailing list