summaryrefslogtreecommitdiff
path: root/source4/libcli/composite
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-08 03:06:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:54 -0500
commited962c833bd37b05c1fadd1857b22b5566d7f850 (patch)
tree97ac192c221706b53d3c98f2dcc4dbb05169a9db /source4/libcli/composite
parenta22780bd4c1ebf69258594105bee479fd1c1cf79 (diff)
downloadsamba-ed962c833bd37b05c1fadd1857b22b5566d7f850.tar.gz
samba-ed962c833bd37b05c1fadd1857b22b5566d7f850.tar.bz2
samba-ed962c833bd37b05c1fadd1857b22b5566d7f850.zip
r18243: when setting up a composite continuation, if the context has already
finished when we need to trigger the continuation immediately. Via a fairly complex path, this fixes the problem where all hosts in the build farm that do not have ipv6 failed a lot of the RPC tests. This happened because the dcerpc_connect() async code used a composite_continue() on a context which was already in an error state, due to the socket backend saying that ipv6 was unavailable (This used to be commit dbf935d38b6b1fea5ed00e94c9b1a518cb14768b)
Diffstat (limited to 'source4/libcli/composite')
-rw-r--r--source4/libcli/composite/composite.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index aea25f183e..e690c33f58 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -142,6 +142,13 @@ _PUBLIC_ void composite_continue(struct composite_context *ctx,
if (composite_nomem(new_ctx, ctx)) return;
new_ctx->async.fn = continuation;
new_ctx->async.private_data = private_data;
+
+ /* if we are setting up a continuation, and the context has
+ already finished, then we should run the callback with an
+ immediate event, otherwise we can be stuck forever */
+ if (new_ctx->state >= COMPOSITE_STATE_DONE && continuation) {
+ event_add_timed(new_ctx->event_ctx, new_ctx, timeval_zero(), composite_trigger, new_ctx);
+ }
}
_PUBLIC_ void composite_continue_rpc(struct composite_context *ctx,