From d7a24b9a7255efc668e64c92df52db197461278f Mon Sep 17 00:00:00 2001 From: Luca Spiller Date: Fri, 17 Jun 2011 15:39:19 +0100 Subject: [PATCH] Decode data before passing to callback --- src/stream_client.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stream_client.erl b/src/stream_client.erl index 67d0b9d..cdd37dd 100644 --- a/src/stream_client.erl +++ b/src/stream_client.erl @@ -23,7 +23,10 @@ handle_connection(Callback, RequestId) -> handle_connection(Callback, RequestId); {http, {RequestId, stream, Data}} -> - _CallbackPid = spawn(fun() -> Callback(Data) end), + spawn(fun() -> + DecodedData = stream_client_util:decode(Data), + Callback(DecodedData) + end), handle_connection(Callback, RequestId); {http, {RequestId, stream_end, _Headers}} ->