From 556645d8d73b1de8ba453ee2fba2bc659a7962f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 7 Oct 2020 11:44:54 +0200 Subject: Default keepalive to infinity for all protocols For HTTP/2 some servers are not fond of receiving pings, especially if there's no stream at the time. (particularly gRPC servers). This is an odd decision for sure. Rather than trying to accomodate for their logic the ping is no longer sent by default. For Websocket sending a ping is a new feature in Gun 2.0 so I'm just being conservative there. --- src/gun_http2.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gun_http2.erl') diff --git a/src/gun_http2.erl b/src/gun_http2.erl index 7677076..e2aeb4a 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -164,7 +164,7 @@ do_check_options([Opt={Name, _}|Opts]) -> name() -> http2. opts_name() -> http2_opts. has_keepalive() -> true. -default_keepalive() -> 5000. +default_keepalive() -> infinity. init(_ReplyTo, Socket, Transport, Opts0) -> %% We have different defaults than the protocol in order -- cgit v1.2.3