From 6f7b59886ec17027b16ed4d10737452e17f233d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 7 Jun 2017 15:15:54 +0200 Subject: Remove NumAcceptors argument from start_clear/tls They are now cowboy:start_clear/3 and cowboy:start_tls/3. The NumAcceptors argument can be specified via the num_acceptor transport option. Ranch has been updated to 1.4.0 to that effect. --- examples/chunked_hello_world/src/chunked_hello_world_app.erl | 2 +- examples/compress_response/src/compress_response_app.erl | 2 +- examples/cookie/src/cookie_app.erl | 2 +- examples/echo_get/src/echo_get_app.erl | 2 +- examples/echo_post/src/echo_post_app.erl | 2 +- examples/eventsource/src/eventsource_app.erl | 2 +- examples/file_server/src/file_server_app.erl | 2 +- examples/hello_world/src/hello_world_app.erl | 2 +- examples/markdown_middleware/src/markdown_middleware_app.erl | 2 +- examples/rest_basic_auth/src/rest_basic_auth_app.erl | 2 +- examples/rest_hello_world/src/rest_hello_world_app.erl | 2 +- examples/rest_pastebin/src/rest_pastebin_app.erl | 2 +- examples/ssl_hello_world/src/ssl_hello_world_app.erl | 2 +- examples/upload/src/upload_app.erl | 2 +- examples/websocket/src/websocket_app.erl | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) (limited to 'examples') diff --git a/examples/chunked_hello_world/src/chunked_hello_world_app.erl b/examples/chunked_hello_world/src/chunked_hello_world_app.erl index fe66908..20abf6e 100644 --- a/examples/chunked_hello_world/src/chunked_hello_world_app.erl +++ b/examples/chunked_hello_world/src/chunked_hello_world_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), chunked_hello_world_sup:start_link(). diff --git a/examples/compress_response/src/compress_response_app.erl b/examples/compress_response/src/compress_response_app.erl index aed2e69..c5fdbf6 100644 --- a/examples/compress_response/src/compress_response_app.erl +++ b/examples/compress_response/src/compress_response_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch}, stream_handlers => [cowboy_compress_h, cowboy_stream_h] }), diff --git a/examples/cookie/src/cookie_app.erl b/examples/cookie/src/cookie_app.erl index 8ce7fdd..8301d17 100644 --- a/examples/cookie/src/cookie_app.erl +++ b/examples/cookie/src/cookie_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {'_', toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), cookie_sup:start_link(). diff --git a/examples/echo_get/src/echo_get_app.erl b/examples/echo_get/src/echo_get_app.erl index b9e0d31..39fefd6 100644 --- a/examples/echo_get/src/echo_get_app.erl +++ b/examples/echo_get/src/echo_get_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), echo_get_sup:start_link(). diff --git a/examples/echo_post/src/echo_post_app.erl b/examples/echo_post/src/echo_post_app.erl index 9bb7591..2c39336 100644 --- a/examples/echo_post/src/echo_post_app.erl +++ b/examples/echo_post/src/echo_post_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), echo_post_sup:start_link(). diff --git a/examples/eventsource/src/eventsource_app.erl b/examples/eventsource/src/eventsource_app.erl index a5f4289..b83a276 100644 --- a/examples/eventsource/src/eventsource_app.erl +++ b/examples/eventsource/src/eventsource_app.erl @@ -17,7 +17,7 @@ start(_Type, _Args) -> {"/", cowboy_static, {priv_file, eventsource, "index.html"}} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), eventsource_sup:start_link(). diff --git a/examples/file_server/src/file_server_app.erl b/examples/file_server/src/file_server_app.erl index 49924ba..3f51855 100644 --- a/examples/file_server/src/file_server_app.erl +++ b/examples/file_server/src/file_server_app.erl @@ -19,7 +19,7 @@ start(_Type, _Args) -> ]}} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch}, middlewares => [cowboy_router, directory_lister, cowboy_handler] }), diff --git a/examples/hello_world/src/hello_world_app.erl b/examples/hello_world/src/hello_world_app.erl index 0e4438b..dc1bd17 100644 --- a/examples/hello_world/src/hello_world_app.erl +++ b/examples/hello_world/src/hello_world_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), hello_world_sup:start_link(). diff --git a/examples/markdown_middleware/src/markdown_middleware_app.erl b/examples/markdown_middleware/src/markdown_middleware_app.erl index 06253bf..819fd53 100644 --- a/examples/markdown_middleware/src/markdown_middleware_app.erl +++ b/examples/markdown_middleware/src/markdown_middleware_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/[...]", cowboy_static, {priv_dir, markdown_middleware, ""}} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch}, middlewares => [cowboy_router, markdown_converter, cowboy_handler] }), diff --git a/examples/rest_basic_auth/src/rest_basic_auth_app.erl b/examples/rest_basic_auth/src/rest_basic_auth_app.erl index cc1718d..b8562bb 100644 --- a/examples/rest_basic_auth/src/rest_basic_auth_app.erl +++ b/examples/rest_basic_auth/src/rest_basic_auth_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), rest_basic_auth_sup:start_link(). diff --git a/examples/rest_hello_world/src/rest_hello_world_app.erl b/examples/rest_hello_world/src/rest_hello_world_app.erl index f966029..e89f633 100644 --- a/examples/rest_hello_world/src/rest_hello_world_app.erl +++ b/examples/rest_hello_world/src/rest_hello_world_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), rest_hello_world_sup:start_link(). diff --git a/examples/rest_pastebin/src/rest_pastebin_app.erl b/examples/rest_pastebin/src/rest_pastebin_app.erl index 98ffe84..31ceff3 100644 --- a/examples/rest_pastebin/src/rest_pastebin_app.erl +++ b/examples/rest_pastebin/src/rest_pastebin_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/[:paste_id]", toppage_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), rest_pastebin_sup:start_link(). diff --git a/examples/ssl_hello_world/src/ssl_hello_world_app.erl b/examples/ssl_hello_world/src/ssl_hello_world_app.erl index ba42b24..009ab8f 100644 --- a/examples/ssl_hello_world/src/ssl_hello_world_app.erl +++ b/examples/ssl_hello_world/src/ssl_hello_world_app.erl @@ -17,7 +17,7 @@ start(_Type, _Args) -> ]} ]), PrivDir = code:priv_dir(ssl_hello_world), - {ok, _} = cowboy:start_tls(https, 100, [ + {ok, _} = cowboy:start_tls(https, [ {port, 8443}, {cacertfile, PrivDir ++ "/ssl/cowboy-ca.crt"}, {certfile, PrivDir ++ "/ssl/server.crt"}, diff --git a/examples/upload/src/upload_app.erl b/examples/upload/src/upload_app.erl index 468d15d..37929cd 100644 --- a/examples/upload/src/upload_app.erl +++ b/examples/upload/src/upload_app.erl @@ -16,7 +16,7 @@ start(_Type, _Args) -> {"/upload", upload_handler, []} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), upload_sup:start_link(). diff --git a/examples/websocket/src/websocket_app.erl b/examples/websocket/src/websocket_app.erl index f89882f..90e6c8d 100644 --- a/examples/websocket/src/websocket_app.erl +++ b/examples/websocket/src/websocket_app.erl @@ -17,7 +17,7 @@ start(_Type, _Args) -> {"/static/[...]", cowboy_static, {priv_dir, websocket, "static"}} ]} ]), - {ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{ + {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), websocket_sup:start_link(). -- cgit v1.2.3