summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-21 01:44:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:02:21 -0500
commit34f84aae5577fb1989b001cfad4de581f33eb102 (patch)
tree6f7199c1f87e88fc03b07d17662c216a2e6840e4 /source4/librpc/rpc
parent5b09d503fffc36de224bdbffb17a84316da0459a (diff)
downloadsamba-34f84aae5577fb1989b001cfad4de581f33eb102.tar.gz
samba-34f84aae5577fb1989b001cfad4de581f33eb102.tar.bz2
samba-34f84aae5577fb1989b001cfad4de581f33eb102.zip
r3103: use a destructor to ensure that on abnormnal rpc request termination
it is removed from the pending list. (This used to be commit 33176e9751374de3b5dc3f5f9b19c6824140d90a)
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index d41eebbf2f..e522f91423 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -820,6 +820,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
*/
struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p,
@@ -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;
}