fix(emqx_auth_http): make configure backward compatible

This commit is contained in:
firest 2022-07-06 17:04:12 +08:00
parent 85b0ce3843
commit 6cd79f92e0
2 changed files with 22 additions and 3 deletions

View File

@ -139,7 +139,7 @@ auth.http.pool_size = 32
## Whether to enable HTTP Pipelining
##
## See: https://en.wikipedia.org/wiki/HTTP_pipelining
auth.http.enable_pipelining = true
auth.http.enable_pipelining = 100
##------------------------------------------------------------------------------
## SSL options

View File

@ -110,10 +110,29 @@ end}.
]}.
{mapping, "auth.http.enable_pipelining", "emqx_auth_http.enable_pipelining", [
{default, 100},
{datatype, integer}
{default, "100"},
{datatype, string}
]}.
{translation, "emqx_auth_http.enable_pipelining", fun(Conf) ->
case cuttlefish:conf_get("auth.http.enable_pipelining", Conf, undefined) of
undefined -> 100;
Str ->
try
erlang:list_to_integer(Str)
catch _:_ ->
case erlang:list_to_atom(Str) of
true ->
100;
false ->
1;
_ ->
100
end
end
end
end}.
{mapping, "auth.http.ssl.cacertfile", "emqx_auth_http.cacertfile", [
{datatype, string}
]}.