From 641211ecae8b2a0348eab1656aba4c2bc2cfd4f8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Feb 2024 17:45:46 +0100 Subject: [PATCH] Minor improvements Signed-off-by: Steffen Jaeckel --- src/auth.c | 5 ++--- tests/test_stanza.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/auth.c b/src/auth.c index f53fb06..058434a 100644 --- a/src/auth.c +++ b/src/auth.c @@ -1106,10 +1106,9 @@ _handle_features_sasl(xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata) xmpp_timed_handler_delete(conn, _handle_missing_features_sasl); /* Check whether resource binding is required */ - bind = xmpp_stanza_get_child_by_name(stanza, "bind"); + bind = xmpp_stanza_get_child_by_name_and_ns(stanza, "bind", XMPP_NS_BIND); if (bind) { - ns = xmpp_stanza_get_ns(bind); - conn->bind_required = ns != NULL && strcmp(ns, XMPP_NS_BIND) == 0; + conn->bind_required = 1; bind = xmpp_stanza_copy(bind); if (!bind) { disconnect_mem_error(conn); diff --git a/tests/test_stanza.c b/tests/test_stanza.c index 964532e..5bf857c 100644 --- a/tests/test_stanza.c +++ b/tests/test_stanza.c @@ -175,7 +175,7 @@ static void test_stanza_error(xmpp_ctx_t *ctx) xmpp_stanza_reply_error(stanza, "cancel", "service-unavailable", NULL); assert(error != NULL); mood = xmpp_stanza_new_from_string(ctx, str_mood); - assert(stanza != NULL); + assert(mood != NULL); assert(xmpp_stanza_get_to(error) != NULL); COMPARE("romeo@montague.lit/home", xmpp_stanza_get_to(error));