aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_req.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-09-16 13:57:27 +0200
committerLoïc Hoguin <[email protected]>2012-09-17 13:57:28 +0200
commitf205d44518800ff669ce8421dcb5f8f04fc6cccb (patch)
tree60a674ba54b5738fa01a722ebd893de8fba76ea8 /src/cowboy_req.erl
parent8d5f8db90a10a8ca16f8f17bcb076ff4b93e9c63 (diff)
downloadcowboy-f205d44518800ff669ce8421dcb5f8f04fc6cccb.tar.gz
cowboy-f205d44518800ff669ce8421dcb5f8f04fc6cccb.tar.bz2
cowboy-f205d44518800ff669ce8421dcb5f8f04fc6cccb.zip
Add a function to lock request responses instead of inlining
Just more cleanup in order to have req() opaque.
Diffstat (limited to 'src/cowboy_req.erl')
-rw-r--r--src/cowboy_req.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 7bc8ad6..741a8f1 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -103,6 +103,7 @@
%% Misc API.
-export([compact/1]).
+-export([lock/1]).
-export([to_list/1]).
-export([transport/1]).
@@ -908,6 +909,12 @@ compact(Req) ->
bindings=undefined, headers=[],
p_headers=[], cookies=[]}.
+%% @doc Prevent any further responses.
+%% @private
+-spec lock(Req) -> Req when Req::req().
+lock(Req) ->
+ Req#http_req{resp_state=locked}.
+
%% @doc Convert the Req object to a list of key/values.
-spec to_list(req()) -> [{atom(), any()}].
to_list(Req) ->