If the user enables the tls-rust feature and forgets to disable
default-features (which includes tls-native), tell them and bail out.
The code was made to work anyway when both are enabled, and here it
defaults to tls-native. It does seem better to have one explicitely
choose one though hence the compile_error! message.
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This needs to be a loop in order to ignore packets we don’t care about,
or those we want to handle elsewhere. Returning something isn’t correct
in those two cases because it would signal to tokio that the XMPPStream
is also done, while there could be additional packets waiting for us.
The proper solution is thus a loop which we exit once we have something
to return.
Fixes a deadlock when we ignore some packets.
The previous commit didn't fix a bug where @id would be added to
elements that didn't need it / where it was invalid (e.g., stream
management).
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit moves the code adding @id to AsyncClient and SimpleClient,
instead of on the lower level send_stanza helper, which seemed to only
be used internally.
Support is also added for Component.
This removes the addition of @id on elements like <auth/> or <bind/>,
which probably weren't required anyway?
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>