loudmouth/lm-connection.c
changeset 339 b1e0d0551a8c
parent 338 e89c3874d6eb
child 340 ce4dcda8797c
equal deleted inserted replaced
338:e89c3874d6eb 339:b1e0d0551a8c
   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_debug ("%s: error while binding to resource", G_STRFUNC);
   993 		g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, "%s: error while binding to resource", G_STRFUNC);
   994 	
   994 	
   995 		connection_call_auth_cb (connection, FALSE);
   995 		connection_call_auth_cb (connection, FALSE);
   996 		
   996 		
   997 		return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   997 		return LM_HANDLER_RESULT_REMOVE_MESSAGE;
   998 	}
   998 	}
  1056 		} else if (!connection->tls_started &&
  1056 		} else if (!connection->tls_started &&
  1057 				lm_ssl_get_require_starttls (connection->ssl)) {
  1057 				lm_ssl_get_require_starttls (connection->ssl)) {
  1058 			/* If there were no starttls features present and we require it, this is
  1058 			/* If there were no starttls features present and we require it, this is
  1059 			 * the place to scream. */
  1059 			 * the place to scream. */
  1060 
  1060 
  1061 			g_debug ("%s: required StartTLS feature not supported by server", G_STRFUNC);
  1061 			g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, "%s: required StartTLS feature not supported by server", G_STRFUNC);
  1062 			connection_do_close (connection);
  1062 			connection_do_close (connection);
  1063 			connection_signal_disconnect (connection,
  1063 			connection_signal_disconnect (connection,
  1064 				LM_DISCONNECT_REASON_ERROR);
  1064 				LM_DISCONNECT_REASON_ERROR);
  1065 			return LM_HANDLER_RESULT_REMOVE_MESSAGE;
  1065 			return LM_HANDLER_RESULT_REMOVE_MESSAGE;
  1066 		}
  1066 		}
  1097 							bind_handler, NULL);
  1097 							bind_handler, NULL);
  1098 		lm_message_handler_unref (bind_handler);
  1098 		lm_message_handler_unref (bind_handler);
  1099 		lm_message_unref (bind_msg);
  1099 		lm_message_unref (bind_msg);
  1100 
  1100 
  1101 		if (result < 0) {
  1101 		if (result < 0) {
  1102 			g_debug ("%s: can't send resource binding request", G_STRFUNC);
  1102 			g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, 
       
  1103 			       "%s: can't send resource binding request", G_STRFUNC);
  1103 			connection_do_close (connection);
  1104 			connection_do_close (connection);
  1104 		}
  1105 		}
  1105 	}
  1106 	}
  1106 
  1107 
  1107 	old_auth = lm_message_node_find_child (message->node, "auth");
  1108 	old_auth = lm_message_node_find_child (message->node, "auth");
  1108 	if (connection->use_sasl && old_auth) {
  1109 	if (connection->use_sasl && old_auth) {
  1109 		g_debug ("Server uses XEP-0078 (jabber iq auth) instead of SASL");
  1110 		g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SASL, "Server uses XEP-0078 (jabber iq auth) instead of SASL");
  1110 		/* So the server is XMPP1.0, but doesn't support SASL and uses
  1111 		/* So the server is XMPP1.0, but doesn't support SASL and uses
  1111 		 * obsolete XEP-0078 instead. Let's cope. */
  1112 		 * obsolete XEP-0078 instead. Let's cope. */
  1112 
  1113 
  1113 		connection->use_sasl = FALSE;
  1114 		connection->use_sasl = FALSE;
  1114 
  1115