aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/mod_auth_dets.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-05-21 16:03:25 +0200
committerIngela Anderton Andin <[email protected]>2015-06-04 10:47:35 +0200
commitfdfda2fab0921d409789174556582db28141448e (patch)
tree3515e7d7dc29bda21a959bfd28a97fc1639933ce /lib/inets/src/http_server/mod_auth_dets.erl
parente99daf3212fbc381074e5be229465e9b6269e204 (diff)
downloadotp-fdfda2fab0921d409789174556582db28141448e.tar.gz
otp-fdfda2fab0921d409789174556582db28141448e.tar.bz2
otp-fdfda2fab0921d409789174556582db28141448e.zip
inets: Add profile option
To enable the HTTP server to run in a virtualized environment, where there can be more that one server that has the same bind_address and port, we add a new option profile. The profile name will be used in concatenation with bind_address and port to identify the HTTP server instance. The name profile was chosen as there is a similar concept in the HTTP client where profile names can be used to instantiate client configurations.
Diffstat (limited to 'lib/inets/src/http_server/mod_auth_dets.erl')
-rw-r--r--lib/inets/src/http_server/mod_auth_dets.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/mod_auth_dets.erl b/lib/inets/src/http_server/mod_auth_dets.erl
index a48725d5d9..ff81a68dd4 100644
--- a/lib/inets/src/http_server/mod_auth_dets.erl
+++ b/lib/inets/src/http_server/mod_auth_dets.erl
@@ -50,11 +50,12 @@ store_directory_data(_Directory, DirData, Server_root) ->
DirData, Server_root),
Addr = proplists:get_value(bind_address, DirData),
Port = proplists:get_value(port, DirData),
+ Profile = proplists:get_value(profile, DirData, ?DEFAULT_PROFILE),
- PWName = httpd_util:make_name("httpd_dets_pwdb",Addr,Port),
+ PWName = httpd_util:make_name("httpd_dets_pwdb", Addr, Port, Profile),
case dets:open_file(PWName,[{type,set},{file,Absolute_pwdfile},{repair,true}]) of
{ok, PWDB} ->
- GDBName = httpd_util:make_name("httpd_dets_groupdb",Addr,Port),
+ GDBName = httpd_util:make_name("httpd_dets_groupdb", Addr, Port, Profile),
case dets:open_file(GDBName,[{type,set},{file,Absolute_groupfile},{repair,true}]) of
{ok, GDB} ->
NDD1 = lists:keyreplace(auth_user_file, 1, DirData,