From 0fe54af72b81fdb198a377198d7f3a91f9ad6d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 14 Aug 2017 14:57:59 +0200 Subject: Allow an infinity keepalive value This disables the keepalive mechanism entirely. --- test/gun_SUITE.erl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/gun_SUITE.erl b/test/gun_SUITE.erl index 842d40c..a7e2169 100644 --- a/test/gun_SUITE.erl +++ b/test/gun_SUITE.erl @@ -110,6 +110,20 @@ info(_) -> #{sock_ip := _, sock_port := _} = gun:info(Pid), ok. +keepalive_infinity(_) -> + doc("Ensure infinity for keepalive is accepted by all protocols."), + {ok, Pid} = gun:open("localhost", 12345, #{ + http_opts => #{keepalive => infinity}, + http2_opts => #{keepalive => infinity}, + retry => 0}), + Ref = monitor(process, Pid), + receive + {'DOWN', Ref, process, Pid, {{gone, _}, _}} -> + ok + after 5000 -> + error(timeout) + end. + reply_to(_) -> doc("The reply_to option allows using a separate process for requests."), do_reply_to(http), -- cgit v1.2.3