988 int result; |
988 int result; |
989 LmMessageSubType type; |
989 LmMessageSubType type; |
990 |
990 |
991 type = lm_message_get_sub_type (message); |
991 type = lm_message_get_sub_type (message); |
992 if (type == LM_MESSAGE_SUB_TYPE_ERROR) { |
992 if (type == LM_MESSAGE_SUB_TYPE_ERROR) { |
993 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, "%s: error while binding to resource", G_STRFUNC); |
993 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, |
|
994 "%s: error while binding to resource\n", G_STRFUNC); |
994 |
995 |
995 connection_call_auth_cb (connection, FALSE); |
996 connection_call_auth_cb (connection, FALSE); |
996 |
997 |
997 return LM_HANDLER_RESULT_REMOVE_MESSAGE; |
998 return LM_HANDLER_RESULT_REMOVE_MESSAGE; |
998 } |
999 } |
1056 } else if (!connection->tls_started && |
1057 } else if (!connection->tls_started && |
1057 lm_ssl_get_require_starttls (connection->ssl)) { |
1058 lm_ssl_get_require_starttls (connection->ssl)) { |
1058 /* If there were no starttls features present and we require it, this is |
1059 /* If there were no starttls features present and we require it, this is |
1059 * the place to scream. */ |
1060 * the place to scream. */ |
1060 |
1061 |
1061 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, "%s: required StartTLS feature not supported by server", G_STRFUNC); |
1062 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, |
|
1063 "%s: required StartTLS feature not supported by server\n", G_STRFUNC); |
1062 connection_do_close (connection); |
1064 connection_do_close (connection); |
1063 connection_signal_disconnect (connection, |
1065 connection_signal_disconnect (connection, |
1064 LM_DISCONNECT_REASON_ERROR); |
1066 LM_DISCONNECT_REASON_ERROR); |
1065 return LM_HANDLER_RESULT_REMOVE_MESSAGE; |
1067 return LM_HANDLER_RESULT_REMOVE_MESSAGE; |
1066 } |
1068 } |
1098 lm_message_handler_unref (bind_handler); |
1100 lm_message_handler_unref (bind_handler); |
1099 lm_message_unref (bind_msg); |
1101 lm_message_unref (bind_msg); |
1100 |
1102 |
1101 if (result < 0) { |
1103 if (result < 0) { |
1102 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, |
1104 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, |
1103 "%s: can't send resource binding request", G_STRFUNC); |
1105 "%s: can't send resource binding request\n", G_STRFUNC); |
1104 connection_do_close (connection); |
1106 connection_do_close (connection); |
1105 } |
1107 } |
1106 } |
1108 } |
1107 |
1109 |
1108 old_auth = lm_message_node_find_child (message->node, "auth"); |
1110 old_auth = lm_message_node_find_child (message->node, "auth"); |
1109 if (connection->use_sasl && old_auth) { |
1111 if (connection->use_sasl && old_auth) { |
1110 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, "Server uses XEP-0078 (jabber iq auth) instead of SASL"); |
1112 g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, |
|
1113 "Server uses XEP-0078 (jabber iq auth) instead of SASL\n"); |
1111 /* So the server is XMPP1.0, but doesn't support SASL and uses |
1114 /* So the server is XMPP1.0, but doesn't support SASL and uses |
1112 * obsolete XEP-0078 instead. Let's cope. */ |
1115 * obsolete XEP-0078 instead. Let's cope. */ |
1113 |
1116 |
1114 connection->use_sasl = FALSE; |
1117 connection->use_sasl = FALSE; |
1115 |
1118 |