mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Always dialyze tests and fix some cowboy_req specs
This commit is contained in:
parent
07078eb47b
commit
a8335c63df
11 changed files with 25 additions and 11 deletions
|
@ -2,6 +2,10 @@
|
|||
|
||||
-module(resp_h).
|
||||
|
||||
%% @todo Probably should have a separate handler for errors,
|
||||
%% so that we can dialyze all the other correct calls.
|
||||
-dialyzer({nowarn_function, do/3}).
|
||||
|
||||
-export([init/2]).
|
||||
|
||||
init(Req, Opts) ->
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
-module(resp_iolist_body_h).
|
||||
|
||||
-dialyzer(no_improper_lists).
|
||||
|
||||
-export([init/2]).
|
||||
|
||||
init(Req0, State) ->
|
||||
|
|
|
@ -107,6 +107,7 @@ early_error(StreamID, Reason, PartialReq, Resp, Opts) ->
|
|||
end.
|
||||
|
||||
%% @todo It would be good if we could allow this function to return normally.
|
||||
-spec takeover(_, _, _, _, _, _, _) -> no_return().
|
||||
takeover(Parent, Ref, Socket, Transport, Opts, Buffer, State=#state{pid=Pid}) ->
|
||||
Pid ! {Pid, self(), takeover, Parent, Ref, Socket, Transport, Opts, Buffer, State},
|
||||
exit(normal).
|
||||
|
|
|
@ -27,6 +27,8 @@ info(_, _, State) ->
|
|||
terminate(_, _, _) ->
|
||||
ok.
|
||||
|
||||
%% @todo It would be good if we could allow this function to return normally.
|
||||
-spec takeover(_, _, _, _, _, _, _) -> no_return().
|
||||
takeover(_, _, _, _, _, _, Pid) ->
|
||||
Msgs = receive_all([]),
|
||||
Pid ! {Pid, Msgs},
|
||||
|
|
|
@ -31,4 +31,5 @@ websocket_info(_, State) ->
|
|||
{ok, State}.
|
||||
|
||||
terminate(Reason, Req, #state{pid=Pid}) ->
|
||||
Pid ! {terminate, Reason, Req}.
|
||||
Pid ! {terminate, Reason, Req},
|
||||
ok.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue