diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index f00462d55..8cb7d2e19 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -2021,7 +2021,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) -> DeliverPayloads = get_option(Options, deliver_payloads), PersistItems = get_option(Options, persist_items), PayloadCount = payload_xmlelements(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), % pubsub#deliver_payloads true % pubsub#persist_items true -> 1 item; false -> 0 item diff --git a/src/mod_pubsub/mod_pubsub_odbc.erl b/src/mod_pubsub/mod_pubsub_odbc.erl index 3d3246b64..f6a8653ed 100644 --- a/src/mod_pubsub/mod_pubsub_odbc.erl +++ b/src/mod_pubsub/mod_pubsub_odbc.erl @@ -1837,7 +1837,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) -> DeliverPayloads = get_option(Options, deliver_payloads), PersistItems = get_option(Options, persist_items), PayloadCount = payload_xmlelements(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), % pubsub#deliver_payloads true % pubsub#persist_items true -> 1 item; false -> 0 item