-
Notifications
You must be signed in to change notification settings - Fork 429
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
Add port and ip in the listener opts for websockets and bosh #3977
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3977 +/- ##
==========================================
+ Coverage 83.55% 83.63% +0.08%
==========================================
Files 538 538
Lines 33974 33975 +1
==========================================
+ Hits 28386 28415 +29
+ Misses 5588 5560 -28
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
5138904
to
57f58f1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
57f58f1
to
5a6a6da
Compare
This comment was marked as outdated.
This comment was marked as outdated.
5a6a6da
to
7f70812
Compare
small_tests_24 / small_tests / 7f70812 small_tests_25 / small_tests / 7f70812 ldap_mnesia_24 / ldap_mnesia / 7f70812 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 7f70812 ldap_mnesia_25 / ldap_mnesia / 7f70812 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 7f70812 dynamic_domains_mysql_redis_25 / mysql_redis / 7f70812 pgsql_mnesia_24 / pgsql_mnesia / 7f70812 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 7f70812 internal_mnesia_25 / internal_mnesia / 7f70812 pgsql_mnesia_25 / pgsql_mnesia / 7f70812 riak_mnesia_24 / riak_mnesia / 7f70812 mysql_redis_25 / mysql_redis / 7f70812 mssql_mnesia_25 / odbc_mssql_mnesia / 7f70812 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 7f70812 service_domain_db_SUITE:db:db_deleted_from_one_node_while_service_disabled_on_another{error,
{{badmatch,{error,not_found}},
[{service_domain_db_SUITE,
db_deleted_from_one_node_while_service_disabled_on_another,1,
[{file,
"/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
{line,588}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 7f70812 |
src/mod_bosh_socket.erl
Outdated
BoshSocket = #bosh_socket{sid = Sid, pid = self(), peer = Peer, peercert = PeerCert}, | ||
C2SOpts = #{access => all, | ||
shaper => none, | ||
xml_socket => true, | ||
max_stanza_size => 0, | ||
hibernate_after => 0, | ||
c2s_state_timeout => 5000, | ||
backwards_compatible_session => true}, | ||
backwards_compatible_session => true, | ||
port => Port, ip_tuple => IPTuple, proto => tcp}, |
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.
This port should be the listener's one. I ran the test, see:
when=2023-03-07T10:55:39.308479+00:00 level=debug what=bosh_socket_init pid=<0.5400.0> at=mod_bosh_socket:init/1:208 sid=5b6140fbac13ae46568a8634e4ffe33ce0469041 peer={{127,0,0,1},49421} c2s_pid=<0.5401.0>
(...)
when=2023-03-07T10:55:39.354863+00:00 level=debug what=bosh_socket_init pid=<0.5436.0> at=mod_bosh_socket:init/1:208 sid=e738430a2769beb809207398d02a8bad38ad7721 peer={{127,0,0,1},49423} c2s_pid=<0.5437.0>
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.
Riiiiiiight, I was understanding bosh wrong!
Should be fixed now 🙂
small_tests_24 / small_tests / 1ffe149 small_tests_25 / small_tests / 1ffe149 ldap_mnesia_24 / ldap_mnesia / 1ffe149 pubsub_SUITE:dag+basic:subscribe_unsubscribe_test{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,491}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,481}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,471}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 1ffe149 ldap_mnesia_25 / ldap_mnesia / 1ffe149 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 1ffe149 dynamic_domains_mysql_redis_25 / mysql_redis / 1ffe149 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 1ffe149 pgsql_mnesia_24 / pgsql_mnesia / 1ffe149 internal_mnesia_25 / internal_mnesia / 1ffe149 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 1ffe149 pgsql_mnesia_25 / pgsql_mnesia / 1ffe149 mssql_mnesia_25 / odbc_mssql_mnesia / 1ffe149 muc_SUITE:register:user_submits_registration_form{error,
{{assertion_failed,assert,is_iq_result,
[{xmlel,<<"iq">>,
[{<<"type">>,<<"set">>},
{<<"id">>,<<"cfa4c6a377c30bedd66e737cf38c2f7d">>},
{<<"to">>,<<"muc.localhost">>}],
[{xmlel,<<"query">>,
[{<<"xmlns">>,<<"jabber:iq:register">>}],
[{xmlel,<<"x">>,
[{<<"xmlns">>,<<"jabber:x:data">>},
{<<"type">>,<<"submit">>}],
[{xmlel,<<"field">>,
[{<<"type">>,<<"hidden">>},
{<<"var">>,<<"FORM_TYPE">>}],
[{xmlel,<<"value">>,[],
[{xmlcdata,<<"jabber:iq:register">>}]}]},
{xmlel,<<"field">>,
[{<<"type">>,<<"text-single">>},
{<<"var">>,<<"nick">>}],
[{xmlel,<<"value">>,[],
[{xmlcdata,
<<"thirdwitchroom-9aed839284">>}]}]}]}]}]}],
{xmlel,<<"iq">>,
[{<<"from">>,<<"muc.localhost">>},
{<<"to">>,
<<"alice_user_submits_registration_form_2545@localhost/res1">>},
{<<"type">>,<<"error">>},
{<<"id">>,<<"cfa4c6a377c30bedd66e737cf38c2f7d">>}],
[{xmlel,<<"query">>,
[{<<"xmlns">>,<<"jabber:iq:register">>}],
[{xmlel,<<"x">>,
[{<<"xmlns">>,<<"jabber:x:data">>},
{<<"type">>,<<"submit">>}],
[{xmlel,<<"field">>,
[{<<"type">>,<<"hidden">>},
{<<"var">>,<<"FORM_TYPE">>}],
[{xmlel,<<"value">>,[],
... riak_mnesia_24 / riak_mnesia / 1ffe149 mysql_redis_25 / mysql_redis / 1ffe149 mssql_mnesia_25 / odbc_mssql_mnesia / 1ffe149 |
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 good 👍 thanks for fixing the issue.
@@ -319,27 +319,27 @@ get_session_socket(Sid) -> | |||
end. | |||
|
|||
|
|||
-spec maybe_start_session(req(), exml:element()) -> | |||
-spec maybe_start_session(req(), exml:element(), map()) -> |
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.
Why not type-spec them all as mongoose_listener:options()
? This would give better information about the contents.
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.
Because it doesn't have all of the options that belong to the mongoose_listener:options here and then dialyzer would fail :|
transport := TransportOpts0, protocol := ProtocolOpts0} = Opts, | ||
Handlers = [ Handler#{ip_tuple => IPTuple, port => Port, proto => tcp} || Handler <- Handlers0 ], |
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.
Not the prettiest (listener opts mixed up with handler opts), but I guess it's the simplest option, so it's ok.
This adds missing elements to the listener_opts for websockets and bosh and enforces that in dialyzer.