mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Fix stream_body when used by multipart
This commit is contained in:
parent
76d6ed83ce
commit
2645044c6b
1 changed files with 7 additions and 1 deletions
|
@ -472,7 +472,13 @@ stream_body(Req=#http_req{buffer=Buffer, body_state={stream, _, _, _}})
|
|||
stream_body(Req=#http_req{body_state={stream, _, _, _}}) ->
|
||||
stream_body_recv(Req);
|
||||
stream_body(Req=#http_req{body_state=done}) ->
|
||||
{done, Req}.
|
||||
{done, Req};
|
||||
stream_body(Req=#http_req{body_state={multipart, _N, _Fun},
|
||||
transport=Transport, socket=Socket}) ->
|
||||
case Transport:recv(Socket, 0, 5000) of
|
||||
{ok, Data} -> {ok, Data, Req};
|
||||
{error, Reason} -> {error, Reason}
|
||||
end.
|
||||
|
||||
-spec stream_body_recv(#http_req{})
|
||||
-> {ok, binary(), #http_req{}} | {error, atom()}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue