aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/httpd.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-10-10 18:19:23 +0200
committerIngela Anderton Andin <[email protected]>2017-11-01 10:54:20 +0100
commit425b826e7fefe3bd4b174adfb8ead5953dd5dadf (patch)
tree9be47243b1e1c2b7707f5ec9ef567daadaac1789 /lib/inets/src/http_server/httpd.erl
parent2cc5ba70cbbc6b3ace81a2a0324417c3b65265bb (diff)
downloadotp-425b826e7fefe3bd4b174adfb8ead5953dd5dadf.tar.gz
otp-425b826e7fefe3bd4b174adfb8ead5953dd5dadf.tar.bz2
otp-425b826e7fefe3bd4b174adfb8ead5953dd5dadf.zip
inets: Make sure httpd:stop_service is synchronous
Diffstat (limited to 'lib/inets/src/http_server/httpd.erl')
-rw-r--r--lib/inets/src/http_server/httpd.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/httpd.erl b/lib/inets/src/http_server/httpd.erl
index 0b632d24e3..540e68e749 100644
--- a/lib/inets/src/http_server/httpd.erl
+++ b/lib/inets/src/http_server/httpd.erl
@@ -99,7 +99,14 @@ start_service(Conf) ->
stop_service({Address, Port}) ->
stop_service({Address, Port, ?DEFAULT_PROFILE});
stop_service({Address, Port, Profile}) ->
- httpd_sup:stop_child(Address, Port, Profile);
+ Name = httpd_util:make_name("httpd_instance_sup", Address, Port, Profile),
+ Pid = whereis(Name),
+ MonitorRef = erlang:monitor(process, Pid),
+ Result = httpd_sup:stop_child(Address, Port, Profile),
+ receive
+ {'DOWN', MonitorRef, _, _, _} ->
+ Result
+ end;
stop_service(Pid) when is_pid(Pid) ->
case service_info(Pid) of
{ok, Info} ->