-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use map syntax to pass ranch transport options #2188
Conversation
6091.1 / Erlang 19.3 / small_tests / 465fbb3 6091.5 / Erlang 19.3 / ldap_mnesia / 465fbb3 6091.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / 465fbb3 6091.3 / Erlang 19.3 / mysql_redis / 465fbb3 6091.2 / Erlang 19.3 / internal_mnesia / 465fbb3 6091.4 / Erlang 19.3 / odbc_mssql_mnesia / 465fbb3 6091.8 / Erlang 20.0 / pgsql_mnesia / 465fbb3 6091.9 / Erlang 21.0 / riak_mnesia / 465fbb3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR 👍 Looks good, I have one minor refactor suggestion ;)
Codecov Report
@@ Coverage Diff @@
## master #2188 +/- ##
=========================================
+ Coverage 78.63% 78.7% +0.06%
=========================================
Files 329 329
Lines 28448 28447 -1
=========================================
+ Hits 22370 22389 +19
+ Misses 6078 6058 -20
Continue to review full report at Codecov.
|
src/ejabberd_cowboy.erl
Outdated
@@ -127,12 +128,13 @@ do_start_cowboy(Ref, Opts, Retries, SleepTime) -> | |||
do_start_cowboy(Ref, Opts) -> | |||
SSLOpts = gen_mod:get_opt(ssl, Opts, undefined), | |||
NumAcceptors = gen_mod:get_opt(num_acceptors, Opts, 100), | |||
TransportOpts = gen_mod:get_opt(transport_options, Opts, []), | |||
TransportOpts0 = gen_mod:get_opt(transport_options, Opts, #{}), | |||
TransportOpts = TransportOpts0#{numb_acceptros => NumAcceptors}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like typo, should be num_acceptors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Thanks for spotting it so quickly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just force pushed a fix for that.
e5b007d
to
7832417
Compare
6092.1 / Erlang 19.3 / small_tests / 51ed45c 6092.5 / Erlang 19.3 / ldap_mnesia / 51ed45c 6092.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / 51ed45c 6092.3 / Erlang 19.3 / mysql_redis / 51ed45c 6092.2 / Erlang 19.3 / internal_mnesia / 51ed45c 6092.4 / Erlang 19.3 / odbc_mssql_mnesia / 51ed45c 6092.8 / Erlang 20.0 / pgsql_mnesia / 51ed45c 6092.9 / Erlang 21.0 / riak_mnesia / 51ed45c pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"alicE82.937826@localhost/res1">>,escalus_tcp,
<0.8865.1>,
[{event_manager,<0.8817.1>},
{server,<<"localhost">>},
{username,<<"alicE82.937826">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.8817.1>},
{server,<<"localhost">>},
{username,<<"alicE82.937826">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"alicE82.937826">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"alicE82.937826">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"19B9F62A64D9EEF3">>}]},
5000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{pubsub_tools,receive_response,3,
[{file,"pubsub_tools.erl"},{line,446}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"pubsub_tools.erl"},{line,437}]},
{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
[{file,"pep_SUITE.erl"},{line,286}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/d... pubsub_SUITE:dag+basic:retract_when_user_goes_offline_test{error,
{function_clause,
[{lists,zip,
[[{xmlel,<<"item">>,
[{<<"id">>,<<"item1">>}],
[{xmlel,<<"entry">>,
[{<<"xmlns">>,<<"http://www.w3.org/2005/Atom">>}],
[]}]}],
[]],
[{file,"lists.erl"},{line,387}]},
{lists,zip,2,[{file,"lists.erl"},{line,387}]},
{pubsub_tools,check_items,3,[{file,"pubsub_tools.erl"},{line,539}]},
{pubsub_SUITE,'-retract_when_user_goes_offline_test/1-fun-0-',3,
[{file,"pubsub_SUITE.erl"},{line,649}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1545}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1063}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,995}]}]}} mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"eve82.66108@localhost/res1">>,escalus_tcp,
<0.24925.1>,
[{event_manager,<0.24916.1>},
{server,<<"localhost">>},
{username,<<"eve82.66108">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.24916.1>},
{server,<<"localhost">>},
{username,<<"eve82.66108">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"eve82.66108">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"eve82.66108">>},
{server,<<"localhost">>},
{password,<<"password">>},
{port,5222},
{stream_management,true},
{stream_id,<<"A69689EC042AFA85">>}]},
10000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{mod_global_distrib_SUITE,
'-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
4,
[{file,"mod_global_distrib_SUITE.erl"},{line,607}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{tes... |
After upgrading
Cowboy
to version2.6
Ranch was automatically upgraded to version1.7
. This version deprecates old API where transport options are passed as proplists where socket options are mixed with other ranch specific options.This PR uses the new map syntax where all socket specific options like
port
,ip
andssl_opts
are passed assocket_opts
key in the map.