Permalink
Browse files

Use init:script_id() for the server version.

This makes it track releases better and is no longer coupled to the KV
version.
  • Loading branch information...
1 parent 937cac7 commit 151cfb9e53384e02375b25ea8b4721375d86bac5 @seancribbs seancribbs committed Feb 15, 2013
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/riak_api_basic_pb_service.erl
@@ -57,21 +57,18 @@ init() ->
undefined.
%% @doc decode/2 callback. Decodes an incoming message.
-%% @todo Factor this out of riakc_pb to remove the dependency.
decode(Code, Bin) when Code == 1; Code == 7 ->
{ok, riak_pb_codec:decode(Code, Bin)}.
%% @doc encode/1 callback. Encodes an outgoing response message.
-%% @todo Factor this out of riakc_pb to remove the dependency.
encode(Message) ->
{ok, riak_pb_codec:encode(Message)}.
%% @doc process/2 callback. Handles an incoming request message.
process(rpbpingreq, State) ->
{reply, rpbpingresp, State};
process(rpbgetserverinforeq, State) ->
- %% TODO: Think of a better way to present the server version
- {ok, Vsn} = application:get_key(riak_kv, vsn),
+ {_, Vsn} = init:script_id(),
Message = #rpbgetserverinforesp{node = riak_pb_codec:to_binary(node()),
server_version = riak_pb_codec:to_binary(Vsn)},
{reply, Message, State}.

0 comments on commit 151cfb9

Please sign in to comment.