25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

fix empty pubsub payload check

This commit is contained in:
Christophe Romain 2011-02-14 16:48:54 +01:00
parent 4a2005f7cc
commit 72395ba497
2 changed files with 2 additions and 2 deletions

View File

@ -2421,7 +2421,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
DeliverPayloads = get_option(Options, deliver_payloads), DeliverPayloads = get_option(Options, deliver_payloads),
PersistItems = get_option(Options, persist_items), PersistItems = get_option(Options, persist_items),
{PayloadCount, PayloadNS} = payload_els_ns(Payload), {PayloadCount, PayloadNS} = payload_els_ns(Payload),
PayloadSize = size(term_to_binary(Payload)), PayloadSize = size(term_to_binary(Payload))-2, % size(term_to_binary([])) == 2
PayloadMaxSize = get_option(Options, max_payload_size), PayloadMaxSize = get_option(Options, max_payload_size),
InvalidNS = case get_option(Options, type) of InvalidNS = case get_option(Options, type) of
false -> false; false -> false;

View File

@ -2216,7 +2216,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
DeliverPayloads = get_option(Options, deliver_payloads), DeliverPayloads = get_option(Options, deliver_payloads),
PersistItems = get_option(Options, persist_items), PersistItems = get_option(Options, persist_items),
{PayloadCount, PayloadNS} = payload_els_ns(Payload), {PayloadCount, PayloadNS} = payload_els_ns(Payload),
PayloadSize = size(term_to_binary(Payload)), PayloadSize = size(term_to_binary(Payload))-2, % size(term_to_binary([])) == 2
PayloadMaxSize = get_option(Options, max_payload_size), PayloadMaxSize = get_option(Options, max_payload_size),
InvalidNS = case get_option(Options, type) of InvalidNS = case get_option(Options, type) of
false -> false; false -> false;