예제 #1
0
static void
unregister_stanzas(XMPP_SERVER_REC *server)
{
	GSList *tmp, *next;

	if (!IS_XMPP_SERVER(server))
		return;
	for (tmp = server->msg_handlers; tmp != NULL; tmp = next) {
		next = tmp->next;
		if (lm_message_handler_is_valid(tmp->data))
			lm_message_handler_invalidate(tmp->data);
		lm_message_handler_unref(tmp->data);
		server->msg_handlers =
		    g_slist_remove(server->msg_handlers, tmp->data);
	}
}
예제 #2
0
static void
rd_cleanup(struct register_data *rd)
{
	register_data = g_slist_remove(register_data, rd);
	g_free(rd->username);
	g_free(rd->domain);
	g_free(rd->password);
	g_free(rd->address);
	g_free(rd->id);
	if (rd->handler != NULL) {
		if (lm_message_handler_is_valid(rd->handler))
			lm_message_handler_invalidate(rd->handler);
		lm_message_handler_unref(rd->handler);
	}
	if (lm_connection_get_state(rd->lmconn) != LM_CONNECTION_STATE_CLOSED)
		lm_connection_close(rd->lmconn, NULL);
	lm_connection_unref(rd->lmconn);
	g_free(rd);
}