From d87fff1a4c500d9abe3945cbfea792b4eddfa3f2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 19 Aug 2010 17:37:21 +0200 Subject: Bugfix http-poll for correctly parsing binary (thanks to Peter Lemenkov) --- src/web/ejabberd_http_poll.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/web/ejabberd_http_poll.erl b/src/web/ejabberd_http_poll.erl index 0bdbc6287..faa0f3c17 100644 --- a/src/web/ejabberd_http_poll.erl +++ b/src/web/ejabberd_http_poll.erl @@ -272,7 +272,13 @@ handle_event(_Event, StateName, StateData) -> %% {stop, Reason, Reply, NewStateData} %%---------------------------------------------------------------------- handle_sync_event({send, Packet}, _From, StateName, StateData) -> - Output = StateData#state.output ++ [lists:flatten(Packet)], + Packet2 = if + is_binary(Packet) -> + binary_to_list(Packet); + true -> + Packet + end, + Output = StateData#state.output ++ [lists:flatten(Packet2)], Reply = ok, {reply, Reply, StateName, StateData#state{output = Output}}; -- cgit v1.2.3