Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 5 additions and 6 deletions. Show diff stats Hide diff stats

  1. 11  src/stetson_server.erl
11  src/stetson_server.erl
@@ -80,6 +80,9 @@ handle_cast({Type, Bucket, N}, State) ->
80 80
     {noreply, State};
81 81
 handle_cast({Type, Bucket, N, Rate}, State) ->
82 82
     ok = stat(State, Type, Bucket, N, Rate),
  83
+    {noreply, State};
  84
+handle_cast(Msg, State) ->
  85
+    error_logger:warning_msg("Unhandled cast to stetson_server: ~p",[Msg]),
83 86
     {noreply, State}.
84 87
 
85 88
 -spec handle_info(_Info, #s{}) -> {noreply, #s{}}.
@@ -123,12 +126,8 @@ stat(State, timer, Bucket, N) ->
123 126
 %% @private Send the formatted binary packet over the udp socket,
124 127
 %% prepending the ns/namespace
125 128
 send(#s{sock = Sock, host = Host, port = Port, ns = Ns}, Format, Args) ->
126  
-    %% iolist_to_bin even though gen_...:send variants accept deep iolists,
127  
-    %% since it makes logging and testing easier
128  
-    Msg = iolist_to_binary(io_lib:format("~s." ++ Format, [Ns|Args])),
129  
-    case gen_udp:send(Sock, Host, Port, Msg) of
130  
-        _Any -> ok
131  
-    end.
  129
+    Msg = io_lib:format("~s." ++ Format, [Ns|Args]),
  130
+    gen_udp:send(Sock, Host, Port, Msg).
132 131
 
133 132
 -spec split_uri(string(), inet:port_number()) -> {nonempty_string(), inet:port_number()}.
134 133
 %% @private

No commit comments for this range

Something went wrong with that request. Please try again.