Fixed two bugs. The first bug was that if no stream:features was received,

we did not proceed with legacy authentication.  The second bug was that
if no resource was specified, legacy authentication must fail, and this
condition was not being detected.
This commit is contained in:
Jack Moffitt
2005-06-28 23:13:59 +00:00
parent c24df2b5f0
commit 033602a4cb

View File

@@ -63,6 +63,9 @@ static int _handle_missing_features(xmpp_conn_t * const conn,
{
xmpp_debug(conn->ctx, "xmpp", "didn't get stream features");
/* legacy auth will be attempted */
_auth(conn);
return 0;
}
@@ -448,9 +451,17 @@ static void _auth(xmpp_conn_t * const conn)
return;
}
str = xmpp_jid_resource(conn->ctx, conn->jid);
if (str)
if (str) {
xmpp_stanza_set_text(authdata, str);
xmpp_free(conn->ctx, str);
xmpp_free(conn->ctx, str);
} else {
xmpp_stanza_release(authdata);
xmpp_stanza_release(iq);
xmpp_error(conn->ctx, "auth",
"Cannot authenticate without resource");
xmpp_disconnect(conn);
return;
}
xmpp_stanza_add_child(child, authdata);
xmpp_stanza_release(authdata);