Skip to content
Browse files

Handle broken json on websocket/misultin.

  • Loading branch information...
1 parent 2c63662 commit f5d23e7ac06272ce99860afced119d00d535d308 @majek majek committed Oct 18, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/sockjs_http.erl
View
10 src/sockjs_http.erl
@@ -126,9 +126,13 @@ misultin_ws_loop0(Ws, Receive, Self) ->
{browser, ""} ->
misultin_ws_loop0(Ws, Receive, Self);
{browser, Data} ->
- {ok, Decoded} = sockjs_util:decode(Data),
- Receive(Self, {recv, Decoded}),
- misultin_ws_loop0(Ws, Receive, Self);
+ case sockjs_util:decode(Data) of
+ {ok, Decoded} ->
+ Receive(Self, {recv, Decoded}),
+ misultin_ws_loop0(Ws, Receive, Self);
+ {error, _} ->
+ closed
+ end;
closed ->
Receive(Self, closed),
closed;

0 comments on commit f5d23e7

Please sign in to comment.
Something went wrong with that request. Please try again.