From 9beb4988581000b462c42bed0df3bb194258f5fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 7 Feb 2025 17:28:31 +0100 Subject: [PATCH] fixup! Add hibernate option to cowboy_http and cowboy_http2 --- src/cowboy_http.erl | 2 ++ src/cowboy_http2.erl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index e572c4c8..476c6944 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -230,6 +230,8 @@ before_loop(State=#state{opts=#{hibernate := true}}) -> before_loop(State) -> loop(State). +-spec loop(#state{}) -> ok. + loop(State=#state{parent=Parent, socket=Socket, transport=Transport, opts=Opts, buffer=Buffer, timer=TimerRef, children=Children, in_streamid=InStreamID, last_streamid=LastStreamID}) -> diff --git a/src/cowboy_http2.erl b/src/cowboy_http2.erl index 583e7b66..207a9679 100644 --- a/src/cowboy_http2.erl +++ b/src/cowboy_http2.erl @@ -274,6 +274,8 @@ before_loop(State=#state{opts=#{hibernate := true}}, Buffer) -> before_loop(State, Buffer) -> loop(State, Buffer). +-spec loop(#state{}, binary()) -> ok. + loop(State=#state{parent=Parent, socket=Socket, transport=Transport, opts=Opts, timer=TimerRef, children=Children}, Buffer) -> Messages = Transport:messages(),