Minor improvements
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
@@ -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);
|
xmpp_timed_handler_delete(conn, _handle_missing_features_sasl);
|
||||||
|
|
||||||
/* Check whether resource binding is required */
|
/* 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) {
|
if (bind) {
|
||||||
ns = xmpp_stanza_get_ns(bind);
|
conn->bind_required = 1;
|
||||||
conn->bind_required = ns != NULL && strcmp(ns, XMPP_NS_BIND) == 0;
|
|
||||||
bind = xmpp_stanza_copy(bind);
|
bind = xmpp_stanza_copy(bind);
|
||||||
if (!bind) {
|
if (!bind) {
|
||||||
disconnect_mem_error(conn);
|
disconnect_mem_error(conn);
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ static void test_stanza_error(xmpp_ctx_t *ctx)
|
|||||||
xmpp_stanza_reply_error(stanza, "cancel", "service-unavailable", NULL);
|
xmpp_stanza_reply_error(stanza, "cancel", "service-unavailable", NULL);
|
||||||
assert(error != NULL);
|
assert(error != NULL);
|
||||||
mood = xmpp_stanza_new_from_string(ctx, str_mood);
|
mood = xmpp_stanza_new_from_string(ctx, str_mood);
|
||||||
assert(stanza != NULL);
|
assert(mood != NULL);
|
||||||
|
|
||||||
assert(xmpp_stanza_get_to(error) != NULL);
|
assert(xmpp_stanza_get_to(error) != NULL);
|
||||||
COMPARE("romeo@montague.lit/home", xmpp_stanza_get_to(error));
|
COMPARE("romeo@montague.lit/home", xmpp_stanza_get_to(error));
|
||||||
|
|||||||
Reference in New Issue
Block a user