0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Change send_timeout_close test to accomodate macOS

This commit is contained in:
Loïc Hoguin 2023-12-13 17:24:48 +01:00
parent efb681d749
commit 67bd791dcc
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
3 changed files with 28 additions and 21 deletions

View file

@ -19,6 +19,7 @@ init(Req0, #{delay := Delay} = Opts) ->
{cowboy_loop, Req, Opts}.
info(timeout, Req, State) ->
cowboy_req:stream_body(<<0:1000/unit:8>>, nofin, Req),
erlang:send_after(10, self(), timeout),
cowboy_req:stream_body(<<0:10000/unit:8>>, nofin, Req),
%% Equivalent to a 0 timeout.
self() ! timeout,
{ok, Req, State}.