Permalink
Browse files

only allow "1.2.3.4:11211" address format in config

  • Loading branch information...
1 parent 637bfd1 commit 4af6e912ee0f9d06207418115de00067af743876 @echou committed Dec 17, 2009
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/mcache/src/mcache_config.erl
@@ -140,12 +140,14 @@ parse_pools(Pools) ->
end,
NewPools).
-normalize_server({{_,_,_,_}=Addr, Port, Weight}) ->
- {Addr, Port, Weight};
-normalize_server({Addr, Port, Weight}) when is_list(Addr) ->
- {Addr1, _} = normalize_addr(Addr),
- {Addr1, Port, Weight};
-normalize_server({Addr, Weight}) ->
+% now only allow "A.B.C.D:11211" style address
+
+%normalize_server({{_,_,_,_}=Addr, Port, Weight}) ->
+% {Addr, Port, Weight};
+%normalize_server({Addr, Port, Weight}) when is_list(Addr) ->
+% {Addr1, _} = normalize_addr(Addr),
+% {Addr1, Port, Weight};
+normalize_server({Addr, Weight}) when is_list(Addr), is_integer(Weight) ->
{Addr1, Port1} = normalize_addr(Addr),
{Addr1, Port1, Weight}.

0 comments on commit 4af6e91

Please sign in to comment.