Skip to content

Commit

Permalink
Fix stream_body when used by multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1240 authored and essen committed Jul 31, 2012
1 parent 76d6ed8 commit 2645044
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cowboy_http_req.erl
Expand Up @@ -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()}.
Expand Down

0 comments on commit 2645044

Please sign in to comment.