summaryrefslogtreecommitdiff
path: root/source4/lib/stream
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-07-07 18:55:59 +0200
committerStefan Metzmacher <metze@samba.org>2008-07-07 21:42:10 +0200
commit8350a230939dbb734a6c4b9ffa665421f8f05821 (patch)
treeec6fa1be51730585094d80040c1b363c41deb0a0 /source4/lib/stream
parent8bf2127313878aaed20854ab41cb06936bbefbb3 (diff)
downloadsamba-8350a230939dbb734a6c4b9ffa665421f8f05821.tar.gz
samba-8350a230939dbb734a6c4b9ffa665421f8f05821.tar.bz2
samba-8350a230939dbb734a6c4b9ffa665421f8f05821.zip
packet: make it possible to free the packet_context from the send_callback
metze (cherry picked from commit 20795c4a0d5f75561561470231de1a2fad2906ff) (This used to be commit 5d5b4e4ab23e1c630dfde2b9f296681e3979c4e0)
Diffstat (limited to 'source4/lib/stream')
-rw-r--r--source4/lib/stream/packet.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/lib/stream/packet.c b/source4/lib/stream/packet.c
index 51021c1fc6..92fa0e5a54 100644
--- a/source4/lib/stream/packet.c
+++ b/source4/lib/stream/packet.c
@@ -469,7 +469,13 @@ _PUBLIC_ void packet_queue_run(struct packet_context *pc)
if (el->nsent == el->blob.length) {
DLIST_REMOVE(pc->send_queue, el);
if (el->send_callback) {
+ pc->busy = true;
el->send_callback(el->send_callback_private);
+ pc->busy = false;
+ if (pc->destructor_called) {
+ talloc_free(pc);
+ return;
+ }
}
talloc_free(el);
}