summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/mod_pubsub/mod_pubsub.erl11
2 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index c535e951..5fc7ac2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* src/ejabberd_c2s.erl: Bugfix in "from" attribute checking
diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl
index 5e0f1423..0306e331 100644
--- a/src/mod_pubsub/mod_pubsub.erl
+++ b/src/mod_pubsub/mod_pubsub.erl
@@ -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]),
{xmlelement, "item",
[{"jid", jlib:jid_to_string(LJID)},
- {"name", get_item_name(Host, Node, Id)}],
+ {"name", Name}],
[]}
end, AllItems),
{result, NodeItems ++ Items}
@@ -803,8 +804,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]),
{xmlelement, "item", [{"jid", Host}, {"node", SN},
- {"name", get_item_name(Host, Node, RN)}], []}
+ {"name", Name}], []}
end, NodeItems),
{result, Nodes ++ Items}
end,
@@ -2848,8 +2850,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.
-