aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-03-22 13:18:53 +0100
committerLoïc Hoguin <[email protected]>2011-03-22 13:18:53 +0100
commitc645b682e72ae531ba521022f232f505122bfc97 (patch)
tree3fc8389d2fa86962b6b7ca4a46b87f6641b27437 /src
parentc3a36246b5e1bb46257165ccbdf3ca3d37b5be38 (diff)
downloadcowboy-c645b682e72ae531ba521022f232f505122bfc97.tar.gz
cowboy-c645b682e72ae531ba521022f232f505122bfc97.tar.bz2
cowboy-c645b682e72ae531ba521022f232f505122bfc97.zip
Fix spec for cowboy_http_req:body/1 and body/2.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_http_req.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl
index cb09282..ad9bf94 100644
--- a/src/cowboy_http_req.erl
+++ b/src/cowboy_http_req.erl
@@ -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