diff --git a/src/event.c b/src/event.c index ee10fd6..8e8bfea 100644 --- a/src/event.c +++ b/src/event.c @@ -88,7 +88,6 @@ void xmpp_run_once(xmpp_ctx_t *ctx, const unsigned long timeout) int tls_read_bytes = 0; if (ctx->loop_status == XMPP_LOOP_QUIT) return; - ctx->loop_status = XMPP_LOOP_RUNNING; /* send queued data */ connitem = ctx->connlist; @@ -347,6 +346,9 @@ void xmpp_run(xmpp_ctx_t *ctx) xmpp_run_once(ctx, DEFAULT_TIMEOUT); } + /* make it possible to start event loop again */ + ctx->loop_status = XMPP_LOOP_NOTSTARTED; + xmpp_debug(ctx, "event", "Event loop completed."); }