Permalink
Browse files

Test is handle_open is defined in the CallbackMod.

Signed-off-by: François de Metz <francois@stormz.me>
  • Loading branch information...
1 parent 2a91dd1 commit cde7af2b8c7855e3890859f80f550b574ea319ca @francois2metz committed Mar 21, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/yaws_websockets.erl
View
@@ -107,7 +107,12 @@ handshake(Arg, SC, CallbackMod, Opts, Params) ->
% and ssl sockets
{callback, CallbackType} = lists:keyfind(callback, 1, Opts),
- CallbackMod:handle_open(Params),
+ case erlang:function_exported(CallbackMod, handle_open, 1) of
+ true ->
+ CallbackMod:handle_open(Params);
+ false ->
+ ok
+ end,
WSState = #ws_state{sock = CliSock,
vsn = ProtocolVersion,

0 comments on commit cde7af2

Please sign in to comment.