Skip to content

Commit

Permalink
Ignore return value of the setopts call.
Browse files Browse the repository at this point in the history
Resolves:

riak_core_connection.erl:144: Expression produces a value of type 'ok' | {'error',atom()}, but this value is unmatched
  • Loading branch information
cmeiklejohn committed Mar 4, 2014
1 parent e389583 commit b9437fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/riak_core_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ sync_connect_status(_Parent, {IP,Port}, {ClientProtocol, {Options, Module, Args}
case gen_tcp:connect(IP, Port, ?CONNECT_OPTIONS, Timeout) of
{ok, Socket} ->
lager:debug("Setting system options on client side: ~p", [?CONNECT_OPTIONS]),
Transport:setopts(Socket, ?CONNECT_OPTIONS),
_ = Transport:setopts(Socket, ?CONNECT_OPTIONS),

This comment has been minimized.

Copy link
@seancribbs

seancribbs Mar 4, 2014

I wonder is this safe? Should you start up with a connection that has bad options, assuming that specific behaviors are actually in-use? I realize the options are a macro and are probably all valid, but if someone changes them in the future...this code would not crash.

This comment has been minimized.

Copy link
@cmeiklejohn

cmeiklejohn Mar 4, 2014

Author Contributor

I'm all for changing this to an explicit 'ok', but I'd love for @Vagabond to confirm.

This comment has been minimized.

Copy link
@Vagabond

Vagabond Mar 4, 2014

seems like requiring options to be valid is good.

This comment has been minimized.

Copy link
@cmeiklejohn

cmeiklejohn Mar 4, 2014

Author Contributor

Resolved by bd7340f.

SSLEnabled = app_helper:get_env(riak_core, ssl_enabled, false),
%% handshake to make sure it's a riak sub-protocol dispatcher
MyName = symbolic_clustername(),
Expand Down

0 comments on commit b9437fd

Please sign in to comment.