ejabberd development
  1. ejabberd development
  2. EJAB-650

New option resource_conflict to define server action

    Details

      Description

      XMPP-Core bis says [1]:

      If there is already a connected resource of the same name, the server MUST do one of the following:

      1. Not accept the resource identifier provided by the client but instead override it with an XMPP resource identifier that the server generates.
      2. Terminate the current resource and allow the newly-requested resource.
      3. Disallow the newly-requested resource and maintain the current resource.

      Which of these the server does is up to the implementation, although it is RECOMMENDED to implement case #1.

      Currently ejabberd implements #2. It could be implemented #3 (or even also #1) and be configurable.

      [1] http://xmpp.org/internet-drafts/draft-saintandre-rfc3920bis-08.html#bind-clientsubmit-error-conflict

      1. 650-21.patch
        6 kB
        Badlop
      2. ejabberd_c2s.diff
        1 kB
        Lee Boynton
      3. ejabberd_sm.diff
        0.8 kB
        Lee Boynton
      4. error
        2 kB
        Lee Boynton

        Activity

        Hide
        Tamas Jalsovszky
        added a comment -

        It would be great to have all 3 cases covered (especially #3

        Show
        Tamas Jalsovszky
        added a comment - It would be great to have all 3 cases covered (especially #3
        Hide
        Lee Boynton
        added a comment -

        I've written a patch which implements #3, with the intention of adding a config option later on. This works on my test machine, however on my live machine it fails with an error which you can see in the error attachment.

        Show
        Lee Boynton
        added a comment - I've written a patch which implements #3, with the intention of adding a config option later on. This works on my test machine, however on my live machine it fails with an error which you can see in the error attachment.
        Hide
        Badlop
        added a comment -

        I've written a patch which implements #3,

        Good start. I've improved it to support #1 too.

        with the intention of adding a config option later on.

        I've added an option to define what of the three behaviors to use.

        This works on my test machine, however on my live machine it fails with an error which you can see in the error attachment.

        It works correctly for me. According to your error, it seems as if you don't have cyrsasl.beam, or maybe you have a cyrsasl.beam of a very old ejabberd version.

        My attachment 650-21.patch is designed to be applied to ejabberd 2.1.x. It works for me as specified in guide.tex.

        Show
        Badlop
        added a comment - I've written a patch which implements #3, Good start. I've improved it to support #1 too. with the intention of adding a config option later on. I've added an option to define what of the three behaviors to use. This works on my test machine, however on my live machine it fails with an error which you can see in the error attachment. It works correctly for me. According to your error, it seems as if you don't have cyrsasl.beam, or maybe you have a cyrsasl.beam of a very old ejabberd version. My attachment 650-21.patch is designed to be applied to ejabberd 2.1.x. It works for me as specified in guide.tex.
        Hide
        Lee Boynton
        added a comment -

        Works good for me on my development machine too, thanks!

        Show
        Lee Boynton
        added a comment - Works good for me on my development machine too, thanks!
        Hide
        Lee Boynton
        added a comment -

        I've just noticed one problem, we need to lowercase the username before checking if they have an existing resource.

        Show
        Lee Boynton
        added a comment - I've just noticed one problem, we need to lowercase the username before checking if they have an existing resource.
        Hide
        Badlop
        added a comment -

        we need to lowercase the username before checking if they have an existing resource.

        I've fixed this, and committed the result to git.

        Show
        Badlop
        added a comment - we need to lowercase the username before checking if they have an existing resource. I've fixed this, and committed the result to git.

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 36 weeks ago

              Issue deployment