-
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
Introduce XMPP pipelining. #1181
Conversation
3ce0853
to
b78cbcf
Compare
@@ -360,8 +360,6 @@ wait_for_feature_request({xmlstreamelement, El}, StateData) -> | |||
end, | |||
if |
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.
According to Elvis:
Replace the 'if' expression on line 361 with a 'case' expression or function clauses.
@@ -317,7 +303,7 @@ replace_stream_ns(Element, _State) -> | |||
Element. | |||
|
|||
get_parser_opts(<<"<open", _/binary>>) -> [{infinite_stream, true}, {autoreset, true}]; % new-type WS |
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.
According to Elvis:
Line 305 is too long: get_parser_opts(<<"<open", _/binary>>) -> [{infinite_stream, true}, {autoreset, true}]; % new-type WS.
{ok, Req, State}; | ||
websocket_info(reset_stream, Req, #ws_state{parser = Parser} = State) -> | ||
{ok, NewParser} = exml_stream:reset_parser(Parser), | ||
{ok, Req, State#ws_state{ parser = NewParser, open_tag = undefined }}; | ||
websocket_info({set_ping, Value}, Req, State = #ws_state{ping_rate = none}) when is_integer(Value) and (Value > 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.
According to Elvis:
Line 114 is too long: websocket_info({set_ping, Value}, Req, State = #ws_state{ping_rate = none}) when is_integer(Value) and (Value > 0)->.
@@ -360,8 +360,6 @@ wait_for_feature_request({xmlstreamelement, El}, StateData) -> | |||
end, | |||
if |
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.
According to Elvis:
The expression on line 361 and column 21 is nested beyond the maximum level of 3.
fca63fc
to
402358f
Compare
rebar.config
Outdated
@@ -9,7 +9,7 @@ | |||
{base16, ".*", {git, "git://github.com/goj/base16.git", "f78918e"}}, | |||
{cuesport, ".*", {git, "git://github.com/esl/cuesport.git", "d82ff25"}}, | |||
{redo, ".*", {git, "git://github.com/Wallapop/redo.git", "35a8d1c"}}, | |||
{exml, ".*", {git, "git://github.com/esl/exml.git", "2.4.1"}}, | |||
{exml, ".*", {git, "git://github.com/esl/exml.git", {ref, "7b5bfca"}}}, |
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.
Could you change exml ref to esl/exml@d365533 ?
|
||
{shotgun, ".*", {git, "https://github.com/inaka/shotgun.git", "4e67065"}}, | ||
{exml, ".*", {git, "git://github.com/esl/exml.git", "7b5bfca"}}, | ||
{escalus, ".*", {git, "git://github.com/esl/escalus.git", "8f0e101"}} |
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 we need a PR in esl/escalus
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 the changes. I left some comments. Do you think it would be worth to add some tests for error cases? For example if the authentication fails with pipelining?
Thanks! |
This PR introduces pipelining via updating exml to a version that can self-reset XMPP streams, allowing to parse payloads with stream:stream tag and XML declaration in the middle.