This commit is contained in:
Umgeher Torgersen 2024-11-27 21:33:35 +00:00
parent 9da6231702
commit 918de5941b

View file

@ -23,9 +23,9 @@ websocket_handle({text, <<Data/binary>>}, S) ->
{ok, S} {ok, S}
end; end;
websocket_handle({json, #{<<"ref">> := Ref}}, #{wsbus := nil} = S) -> websocket_handle({json, #{<<"ref">> := Ref}}, #{wsbus := nil} = S) ->
{[{text, jsx:encode(#{<<"ref">> => Ref, <<"wsio-code">> => 0})}], S}; {[{text, jsx:encode(#{<<"ref">> => Ref, <<"wsio-code">> => <<"0">>})}], S};
websocket_handle({json, Data}, #{wsbus := BUS} = S) -> websocket_handle({json, Data}, #{wsbus := BUS} = S) ->
gen_server:cast(BUS, {call, Data, self()}), gen_server:cast(BUS, {call, Data}),
{ok, S}; {ok, S};
websocket_handle(_, State) -> websocket_handle(_, State) ->
{ok, State}. {ok, State}.