From f445f6aa314ffd6f8fe0f045f44064484a91162b Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 15 Feb 2015 00:13:45 +0100 Subject: [PATCH] mod_statsdx: Fix vCard statistics --- mod_statsdx/src/mod_statsdx.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod_statsdx/src/mod_statsdx.erl b/mod_statsdx/src/mod_statsdx.erl index b1108bf..a18d70f 100644 --- a/mod_statsdx/src/mod_statsdx.erl +++ b/mod_statsdx/src/mod_statsdx.erl @@ -1685,8 +1685,8 @@ get_users_vcard_fun(#vcard{us = {_, Host1}}, {HostReq, NumRemaining, MinSize, Si when (Host1 /= HostReq) and (HostReq /= server) -> {HostReq, NumRemaining, MinSize, Sizes, Selects}; get_users_vcard_fun(Vcard, {HostReq, NumRemaining, MinSize, Sizes, Selects}) -> - String = lists:flatten(xml:element_to_string(Vcard#vcard.vcard)), - Size = length(String), + Binary = xml:element_to_binary(Vcard#vcard.vcard), + Size = byte_size(Binary), case {Size > MinSize, NumRemaining > 0} of {true, true} -> {User, Host} = Vcard#vcard.us,