diff options
Diffstat (limited to 'test/handlers')
-rw-r--r-- | test/handlers/long_polling_h.erl | 8 | ||||
-rw-r--r-- | test/handlers/loop_handler_body_h.erl | 6 | ||||
-rw-r--r-- | test/handlers/loop_handler_timeout_h.erl | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/test/handlers/long_polling_h.erl b/test/handlers/long_polling_h.erl index 1b240fd..20fe7ee 100644 --- a/test/handlers/long_polling_h.erl +++ b/test/handlers/long_polling_h.erl @@ -11,15 +11,15 @@ init(Req, _) -> erlang:send_after(200, self(), timeout), - {long_polling, Req, 2, 5000, hibernate}. + {cowboy_loop, Req, 2, 5000, hibernate}. info(timeout, Req, 0) -> - {ok, cowboy_req:reply(102, Req), 0}; + {shutdown, cowboy_req:reply(102, Req), 0}; info(timeout, Req, Count) -> erlang:send_after(200, self(), timeout), - {loop, Req, Count - 1, hibernate}. + {ok, Req, Count - 1, hibernate}. -terminate({normal, shutdown}, _, 0) -> +terminate(shutdown, _, 0) -> ok; terminate({error, overflow}, _, _) -> ok. diff --git a/test/handlers/loop_handler_body_h.erl b/test/handlers/loop_handler_body_h.erl index ac75773..096fb3d 100644 --- a/test/handlers/loop_handler_body_h.erl +++ b/test/handlers/loop_handler_body_h.erl @@ -11,12 +11,12 @@ init(Req, _) -> self() ! timeout, - {long_polling, Req, undefined, 5000, hibernate}. + {cowboy_loop, Req, undefined, 5000, hibernate}. info(timeout, Req, State) -> {ok, Body, Req2} = cowboy_req:body(Req), 100000 = byte_size(Body), - {ok, cowboy_req:reply(200, Req2), State}. + {shutdown, cowboy_req:reply(200, Req2), State}. -terminate({normal, shutdown}, _, _) -> +terminate(shutdown, _, _) -> ok. diff --git a/test/handlers/loop_handler_timeout_h.erl b/test/handlers/loop_handler_timeout_h.erl index 8e24d33..a1bfa51 100644 --- a/test/handlers/loop_handler_timeout_h.erl +++ b/test/handlers/loop_handler_timeout_h.erl @@ -1,7 +1,7 @@ %% This module implements a loop handler that sends %% itself a timeout that will intentionally arrive %% too late, as it configures itself to only wait -%% 200ms before closing the connection in init/3. +%% 200ms before closing the connection in init/2. %% This results in a 204 reply being sent back by Cowboy. -module(loop_handler_timeout_h). @@ -12,10 +12,10 @@ init(Req, _) -> erlang:send_after(1000, self(), timeout), - {long_polling, Req, undefined, 200, hibernate}. + {cowboy_loop, Req, undefined, 200, hibernate}. info(timeout, Req, State) -> - {ok, cowboy_req:reply(500, Req), State}. + {shutdown, cowboy_req:reply(500, Req), State}. -terminate({normal, timeout}, _, _) -> +terminate(timeout, _, _) -> ok. |