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

Ensure we can read the request body from any process

This commit is contained in:
Loïc Hoguin 2019-10-02 19:12:05 +02:00
parent 8f6ee9c186
commit 20660d7566
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
5 changed files with 28 additions and 9 deletions

View file

@ -491,7 +491,7 @@ read_body(Req=#{pid := Pid, streamid := StreamID}, Opts) ->
Period = maps:get(period, Opts, 15000),
Timeout = maps:get(timeout, Opts, Period + 1000),
Ref = make_ref(),
Pid ! {{Pid, StreamID}, {read_body, Ref, Length, Period}},
Pid ! {{Pid, StreamID}, {read_body, self(), Ref, Length, Period}},
receive
{request_body, Ref, nofin, Body} ->
{more, Body, Req};