Commits

Anonymous committed 3b5059b Merge

Merged with main branch.

Comments (0)

Files changed (4)

 doc/{edoc-info,*.{png,css,html}}
 cover_report/*
 
+*.orig

src/lhttpc_client.erl

         {response, _, {ok, {no_return, _}}} -> ok;
         _Else -> From ! Result
     end,
+    % Don't send back {'EXIT', self(), normal} if the process
+    % calling us is trapping exits
+    unlink(From), 
     ok.
 
 execute(From, Host, Port, Ssl, Path, Method, Hdrs, Body, Options) ->

test/lhttpc_tests.erl

                 ?_test(limited_partial_download_identity()),
                 ?_test(partial_download_chunked()),
                 ?_test(close_connection()),
+                ?_test(message_queue()),
                 ?_test(connection_count()) % just check that it's 0 (last)
             ]}
     }.
 
 %%% Tests
 
+message_queue() ->
+    receive X -> erlang:error({unexpected_message, X}) after 0 -> ok end.
+
 simple_get() ->
     simple(get),
     simple("GET").

test/webserver.erl

 %%% @end
 -module(webserver).
 
--export([start/2, read_chunked/3]).
--export([accept_connection/3]).
+-export([start/2]).
+-export([accept_connection/4]).
 
 start(Module, Responders) ->
     LS = listen(Module),
-    spawn_link(?MODULE, accept_connection, [Module, LS, Responders]),
+    spawn_link(?MODULE, accept_connection, [self(), Module, LS, Responders]),
     port(Module, LS).
 
-accept_connection(Module, ListenSocket, Responders) ->
+accept_connection(Parent, Module, ListenSocket, Responders) ->
     Socket = accept(Module, ListenSocket),
-    server_loop(Module, Socket, nil, [], Responders).
+    server_loop(Module, Socket, nil, [], Responders),
+    unlink(Parent).
 
 read_chunked(Module, Socket, Headers) ->
     Body = read_chunks(Module, Socket, []),