introduce owner concept in send_queue

In order to be able to distinguish between user-created entries and
library-internal entries, we mark each entry who it belongs to.
This allows then later to let the user manage only the queue entries
that were created by them.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel
2021-11-17 11:23:25 +01:00
parent 57bc4bbb75
commit 27278c032b
8 changed files with 165 additions and 83 deletions

View File

@@ -142,6 +142,8 @@ void xmpp_run_once(xmpp_ctx_t *ctx, unsigned long timeout)
tsq = sq;
sq = sq->next;
conn->send_queue_len--;
if (tsq->owner & XMPP_QUEUE_USER)
conn->send_queue_user_len--;
strophe_free(ctx, tsq);
/* pop the top item */