Skip to content

Commit b21e92b

Browse files
committed
Merge pull request #1843 from UncleGrumpy/http_client_demo_fix
Fix http_client.erl example for active mode Closes #1842 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents b94dfea + 47b326f commit b21e92b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/erlang/http_client.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ loop(Conn) ->
5252
ok;
5353
{ok, UpdatedConn, Responses} ->
5454
io:format("Got: ~p~n", [Responses]),
55-
loop(UpdatedConn);
55+
case maybe_terminate(Responses, UpdatedConn) of
56+
ok -> loop(UpdatedConn);
57+
closed -> ok
58+
end;
5659
unknown ->
5760
io:format("Unexpected message: ~p~n", [Message]),
5861
error

0 commit comments

Comments
 (0)