Skip to content

Commit

Permalink
Decode data before passing to callback
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspiller committed Jun 17, 2011
1 parent 126317b commit d7a24b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/stream_client.erl
Expand Up @@ -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}} ->
Expand Down

0 comments on commit d7a24b9

Please sign in to comment.