mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Fix spec for cowboy_http_req:body/1 and body/2.
This commit is contained in:
parent
c3a36246b5
commit
c645b682e7
1 changed files with 2 additions and 2 deletions
|
@ -140,7 +140,7 @@ headers(Req) ->
|
|||
|
||||
%% @todo We probably want to allow a max length.
|
||||
-spec body(Req::#http_req{})
|
||||
-> {Body::binary(), Req::#http_req{}} | {error, Reason::posix()}.
|
||||
-> {ok, Body::binary(), Req::#http_req{}} | {error, Reason::posix()}.
|
||||
body(Req) ->
|
||||
{Length, Req2} = cowboy_http_req:header('Content-Length', Req),
|
||||
case Length of
|
||||
|
@ -152,7 +152,7 @@ body(Req) ->
|
|||
|
||||
%% @todo We probably want to configure the timeout.
|
||||
-spec body(Length::non_neg_integer(), Req::#http_req{})
|
||||
-> {Body::binary(), Req::#http_req{}} | {error, Reason::posix()}.
|
||||
-> {ok, Body::binary(), Req::#http_req{}} | {error, Reason::posix()}.
|
||||
body(Length, Req=#http_req{socket=Socket, transport=Transport, body_state=waiting}) ->
|
||||
Transport:setopts(Socket, [{packet, raw}]),
|
||||
case Transport:recv(Socket, Length, 5000) of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue