aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-04-28 17:26:40 +0200
committerLoïc Hoguin <[email protected]>2017-04-28 17:26:40 +0200
commitd1358262c878b4644d9e1d9230ae6e129271474b (patch)
tree45a09f3333a4359f8a96abc481627d9c305e5a3e
parent8b9d9937dc4c2a0f8c849b965efed560fa469904 (diff)
downloadgun-d1358262c878b4644d9e1d9230ae6e129271474b.tar.gz
gun-d1358262c878b4644d9e1d9230ae6e129271474b.tar.bz2
gun-d1358262c878b4644d9e1d9230ae6e129271474b.zip
Fix a type and variable name in gun_content_handler
-rw-r--r--src/gun_content_handler.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gun_content_handler.erl b/src/gun_content_handler.erl
index b268f56..34153da 100644
--- a/src/gun_content_handler.erl
+++ b/src/gun_content_handler.erl
@@ -24,24 +24,24 @@
-type state() :: opt() | [{module(), any()}].
-export_type([state/0]).
--callback init(pid(), reference(), cow_http:status(),
+-callback init(pid(), any(), cow_http:status(),
cow_http:headers(), map()) -> {ok, any()} | disable.
%% @todo Make fin | nofin its own type.
-callback handle(fin | nofin, any(), State)
-> {ok, any(), State} | {done, State} when State::any().
--spec init(pid(), reference(), cow_http:status(),
+-spec init(pid(), any(), cow_http:status(),
cow_http:headers(), State) -> State when State::state().
init(_, _, _, _, []) ->
[];
-init(ReplyTo, Owner, Status, Headers, [Handler|Tail]) ->
+init(ReplyTo, StreamRef, Status, Headers, [Handler|Tail]) ->
{Mod, Opts} = case Handler of
Tuple = {_, _} -> Tuple;
Atom -> {Atom, #{}}
end,
- case Mod:init(ReplyTo, Owner, Status, Headers, Opts) of
- {ok, State} -> [{Mod, State}|init(ReplyTo, Owner, Status, Headers, Tail)];
- disable -> init(ReplyTo, Owner, Status, Headers, Tail)
+ case Mod:init(ReplyTo, StreamRef, Status, Headers, Opts) of
+ {ok, State} -> [{Mod, State}|init(ReplyTo, StreamRef, Status, Headers, Tail)];
+ disable -> init(ReplyTo, StreamRef, Status, Headers, Tail)
end.
-spec handle(fin | nofin, any(), State) -> State when State::state().