diff options
author | Péter Dimitrov <[email protected]> | 2019-03-08 14:56:18 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2019-03-08 14:56:18 +0100 |
commit | 9377eeb3335a1552bd8a55a774da1608575ef039 (patch) | |
tree | 77dcd093cbc3fc69e3dbdf106d8881d770b53e33 /lib | |
parent | 7def10d22332fa0e0dd009ff4405b92a184ea3a5 (diff) | |
parent | bf48c2a3d49f06ecd670ba6b298f5910055aa5aa (diff) | |
download | otp-9377eeb3335a1552bd8a55a774da1608575ef039.tar.gz otp-9377eeb3335a1552bd8a55a774da1608575ef039.tar.bz2 otp-9377eeb3335a1552bd8a55a774da1608575ef039.zip |
Merge branch 'peterdmv/inets/httpd_erl_script_timeout/ERIERL-321/OTP-15669' into maint
* peterdmv/inets/httpd_erl_script_timeout/ERIERL-321/OTP-15669:
inets: Fix handling of erl_script_timeout
Change-Id: I6a90408de48df6b8b01f44e0b273507bcec27b13
Diffstat (limited to 'lib')
-rw-r--r-- | lib/inets/src/http_server/mod_esi.erl | 6 | ||||
-rw-r--r-- | lib/inets/test/httpd_SUITE.erl | 15 |
2 files changed, 17 insertions, 4 deletions
diff --git a/lib/inets/src/http_server/mod_esi.erl b/lib/inets/src/http_server/mod_esi.erl index 443b7ee564..f495f12f03 100644 --- a/lib/inets/src/http_server/mod_esi.erl +++ b/lib/inets/src/http_server/mod_esi.erl @@ -33,7 +33,7 @@ -include("httpd_internal.hrl"). -define(VMODULE,"ESI"). --define(DEFAULT_ERL_TIMEOUT,15000). +-define(DEFAULT_ERL_TIMEOUT,15). %%%========================================================================= @@ -174,7 +174,7 @@ store({erl_script_alias, Value}, _) -> {error, {wrong_type, {erl_script_alias, Value}}}; store({erl_script_timeout, TimeoutSec}, _) when is_integer(TimeoutSec) andalso (TimeoutSec >= 0) -> - {ok, {erl_script_timeout, TimeoutSec * 1000}}; + {ok, {erl_script_timeout, TimeoutSec}}; store({erl_script_timeout, Value}, _) -> {error, {wrong_type, {erl_script_timeout, Value}}}; store({erl_script_nocache, Value} = Conf, _) @@ -500,7 +500,7 @@ kill_esi_delivery_process(Pid) -> erl_script_timeout(Db) -> - httpd_util:lookup(Db, erl_script_timeout, ?DEFAULT_ERL_TIMEOUT). + httpd_util:lookup(Db, erl_script_timeout, ?DEFAULT_ERL_TIMEOUT * 1000). script_elements(FuncAndInput, Input) -> case input_type(FuncAndInput) of diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl index 5b6740fba3..fcb9ad7905 100644 --- a/lib/inets/test/httpd_SUITE.erl +++ b/lib/inets/test/httpd_SUITE.erl @@ -78,7 +78,8 @@ all() -> {group, http_rel_path_script_alias}, {group, http_not_sup}, {group, https_not_sup}, - mime_types_format + mime_types_format, + erl_script_timeout_option ]. groups() -> @@ -1777,6 +1778,18 @@ mime_types_format(Config) when is_list(Config) -> {"hqx","application/mac-binhex40"}]} = httpd_conf:load_mime_types(MimeTypes). +erl_script_timeout_option(Config) when is_list(Config) -> + inets:start(), + {ok, Pid} = inets:start(httpd, [{erl_script_timeout, 215}, + {server_name, "test"}, + {port,0}, + {server_root, "."}, + {document_root, "."}]), + Info = httpd:info(Pid), + 215 = proplists:get_value(erl_script_timeout, Info), + inets:stop(). + + %%-------------------------------------------------------------------- %% Internal functions ----------------------------------- %%-------------------------------------------------------------------- |