Skip to content
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

Improve escalus_bosh's handling of session termination #16

Merged
merged 2 commits into from
Apr 15, 2014

Conversation

pzel
Copy link
Contributor

@pzel pzel commented Apr 15, 2014

Previously, if an escalus_bosh connection in keepalive mode received a terminate reply from the server, it would send an empty keepalive response back to the server, instead of just stopping.

The server would have destroyed the session by this time, and would print a warning message:

2014-04-15 11:50:14.621 [warning] <0.860.0>@mod_bosh:forward_body:267 session not found!
{xmlel,<<"body">>,
    [{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},
     {<<"type">>,<<"terminate">>},
     {<<"sid">>,<<" {{ SOME_SID }} ">>},
     {<<"rid">>,<<" {{ SOME_RID }} ">>}],
    [{xmlel,<<"presence">>,[{<<"type">>,<<"unavailable">>}],[]}]}

This commit fixes escalus_bosh to stop sending keepalives upon receiving a terminate response.

Additionally, if a connection is timed out on purpose during an escalus story, one may specify it as terminated using escalus_bosh:mark_as_terminated/1. This will prevent escalus_cleaner from sending extraneous session termination requests to the server after the story finishes.

@pzel pzel changed the title make escalus_bosh stop on terminate msg, even w/keepalive Improve escalus_bosh's handling of session termination Apr 15, 2014
erszcz added a commit that referenced this pull request Apr 15, 2014
Improve escalus_bosh's handling of session termination
@erszcz erszcz merged commit e83a252 into master Apr 15, 2014
@erszcz erszcz deleted the escalus-bosh-fix branch April 15, 2014 15:03
@erszcz erszcz restored the escalus-bosh-fix branch April 15, 2014 15:04
@erszcz
Copy link
Member

erszcz commented Apr 15, 2014

Merged and tagged as 2.4.1.

@erszcz erszcz deleted the escalus-bosh-fix branch October 20, 2014 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants