xmpp-rs/tokio-xmpp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jonas Schäfer fc62229dc5 tokio_xmpp: fix Client on servers without Stream Management
The Client::send_stanza method blocks on the stanza actually being sent
over the stream. Without this change, the method will never return
on streams without XEP-0198 Stream Management because `sm_state` is
then None and thus the StanzaToken's state is never advanced: it would
be stuck in Queued state.

In addition, a lack of advancement to Sent state may cause a deadlock on
XEP-0198-enabled streams if data is received so fast that the
frontend_tx mpsc::Sender in the stanzastream::Worker is filled up. In
such a case, the Worker cannot obtain a permit and will only service
writes. However, that will mean that no StanzaTokens can be advanced
beyond Queued state, because for that, reads need to be serviced (to
receive the SM acks).

If a burst of stanzas is then received while Client::send_stanza is
being awaited, send_stanza can only return if something reads from the
frontend mpsc in the meantime. We do not want to require user code to
drive the Client in full-duplex mode, hence this is a bug.

skip-changelog, because this fixes an unreleased feature.
2025-01-25 12:31:32 +00:00
..
examples tokio_xmpp: Replace std stuff with alloc/core stuff 2024-12-19 20:45:36 +01:00
src tokio_xmpp: fix Client on servers without Stream Management 2025-01-25 12:31:32 +00:00
.gitignore Prepare for merge: Move all tokio-xmpp files into tokio-xmpp/ 2019-10-18 14:16:01 +02:00
Cargo.toml parsers: Add Message::extract_valid_payload helper 2024-12-19 17:36:10 +01:00
ChangeLog tokio-xmpp: Add forgotten ChangeLog entry for ktls support 2024-12-18 18:33:42 +00:00
logo.svg Prepare for merge: Move all tokio-xmpp files into tokio-xmpp/ 2019-10-18 14:16:01 +02:00
README.md tokio-xmpp: remove obsolete TODOs 2020-03-16 00:11:52 +01:00

TODO

  • allow tls verify customization
  • more tests