24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-18 22:15:20 +02:00

fix get_item_name deadlock on transaction

SVN Revision: 1729
This commit is contained in:
Christophe Romain 2008-12-15 19:58:53 +00:00
parent f83fc51960
commit 96aaba738b
2 changed files with 9 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2008-12-15 Christophe Romain <cromain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: fix get_item_name deadlock on
transaction
2008-12-10 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* src/eldap/eldap_utils.erl (case_insensitive_match/2): Replace

View File

@ -393,9 +393,10 @@ disco_sm_items(Acc, From, To, Node, _Lang) ->
fun(#pubsub_item{itemid = Id}) ->
%% "jid" is required by XEP-0030, and
%% "node" is forbidden by XEP-0060.
{result, Name} = node_action(Host, Node, get_item_name, [Host, Node, Id]),
#xmlel{ns = ?NS_DISCO_ITEMS, name = 'item', attrs =
[#xmlattr{name = 'jid', value = exmpp_jid:jid_to_list(LJID)},
#xmlattr{name = 'name', value = get_item_name(Host, Node, Id)}]}
#xmlattr{name = 'name', value = Name}]}
end, AllItems),
{result, NodeItems ++ Items}
end.
@ -800,8 +801,9 @@ iq_disco_items(Host, Item, From) ->
Items = lists:map(
fun(#pubsub_item{itemid = {RN, _}}) ->
SN = node_to_string(Node) ++ "!" ++ RN,
{result, Name} = node_call(Type, get_item_name, [Host, Node, RN]),
#xmlel{ns = ?NS_DISCO_ITEMS, name = 'item', attrs = [#xmlattr{name = 'jid', value = Host}, #xmlattr{name = 'node', value = SN},
#xmlattr{name = 'name', value = get_item_name(Host, Node, RN)}]}
#xmlattr{name = 'name', value = Name}]}
end, NodeItems),
{result, Nodes ++ Items}
end,
@ -2840,8 +2842,3 @@ uniqid() ->
{T1, T2, T3} = now(),
lists:flatten(io_lib:fwrite("~.16B~.16B~.16B", [T1, T2, T3])).
%% @doc Return the name of a given node if available.
get_item_name(Host, Node, Id) ->
{result, Name} = node_action(Host, Node, get_item_name, [Host, Node, Id]),
Name.