r3103: use a destructor to ensure that on abnormnal rpc request termination
authorAndrew Tridgell <tridge@samba.org>
Thu, 21 Oct 2004 01:44:46 +0000 (01:44 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:02:21 +0000 (13:02 -0500)
it is removed from the pending list.
(This used to be commit 33176e9751374de3b5dc3f5f9b19c6824140d90a)

source4/librpc/rpc/dcerpc.c

index d41eebbf2fa47385eeaf1ed11d5e763a4ac1798b..e522f91423539352ad49f1cd2988fea30d322055 100644 (file)
@@ -819,6 +819,16 @@ static void dcerpc_request_recv_data(struct dcerpc_pipe *p,
 }
 
 
+/*
+  make sure requests are cleaned up 
+ */
+static int dcerpc_req_destructor(void *ptr)
+{
+       struct rpc_request *req = ptr;
+       DLIST_REMOVE(req->p->pending, req);
+       return 0;
+}
+
 /*
   perform the send size of a async dcerpc request
 */
@@ -903,6 +913,8 @@ struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p,
                remaining -= chunk;
        }
 
+       talloc_set_destructor(req, dcerpc_req_destructor);
+
        return req;
 }