25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

fix get_item_name deadlock on transaction

SVN Revision: 1728
This commit is contained in:
Christophe Romain 2008-12-15 19:55:35 +00:00
parent 620cbc765c
commit a800ac5a4e
2 changed files with 9 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2008-12-15 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: fix get_item_name deadlock on
transaction
2008-12-12 Alexey Shchepin <alexey@process-one.net> 2008-12-12 Alexey Shchepin <alexey@process-one.net>
* src/ejabberd_c2s.erl: Bugfix in "from" attribute checking * src/ejabberd_c2s.erl: Bugfix in "from" attribute checking

View File

@ -393,9 +393,10 @@ disco_sm_items(Acc, From, To, Node, _Lang) ->
fun(#pubsub_item{itemid = Id}) -> fun(#pubsub_item{itemid = Id}) ->
%% "jid" is required by XEP-0030, and %% "jid" is required by XEP-0030, and
%% "node" is forbidden by XEP-0060. %% "node" is forbidden by XEP-0060.
{result, Name} = node_action(Host, Node, get_item_name, [Host, Node, Id]),
{xmlelement, "item", {xmlelement, "item",
[{"jid", jlib:jid_to_string(LJID)}, [{"jid", jlib:jid_to_string(LJID)},
{"name", get_item_name(Host, Node, Id)}], {"name", Name}],
[]} []}
end, AllItems), end, AllItems),
{result, NodeItems ++ Items} {result, NodeItems ++ Items}
@ -803,8 +804,9 @@ iq_disco_items(Host, Item, From) ->
Items = lists:map( Items = lists:map(
fun(#pubsub_item{itemid = {RN, _}}) -> fun(#pubsub_item{itemid = {RN, _}}) ->
SN = node_to_string(Node) ++ "!" ++ RN, SN = node_to_string(Node) ++ "!" ++ RN,
{result, Name} = node_call(Type, get_item_name, [Host, Node, RN]),
{xmlelement, "item", [{"jid", Host}, {"node", SN}, {xmlelement, "item", [{"jid", Host}, {"node", SN},
{"name", get_item_name(Host, Node, RN)}], []} {"name", Name}], []}
end, NodeItems), end, NodeItems),
{result, Nodes ++ Items} {result, Nodes ++ Items}
end, end,
@ -2848,8 +2850,3 @@ uniqid() ->
{T1, T2, T3} = now(), {T1, T2, T3} = now(),
lists:flatten(io_lib:fwrite("~.16B~.16B~.16B", [T1, T2, T3])). 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.