Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Cannot Reproduce
    • Affects Version/s: ejabberd 3.0.0-alpha-1
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      I'm trying to connect to ejabberd (https://svn.process-one.net/ejabberd/branches/road-to-exmpp, r2653) from exmpp application using the code like

          Session = exmpp_session:start(),
          JID = exmpp_jid:make(ClientName, ?SERVERHOST, random),
          exmpp_session:auth_basic_digest(Session, JID, ?PASSWORD),
          exmpp_session:connect_TCP(Session, ?SERVERHOST, ?SERVERPORT),
          try exmpp_session:login(Session)
      

      Basically, it's the same code as in exmpp example.

      However, connection fails with

      {timeout,{gen_fsm,sync_send_event,[<0.42.0>,{login}]}}
        in function gen_fsm:sync_send_event/2
        in call from exmpp_session:login/1
        in call from client:create_session/1
      

      From ejabberd log it looks like ejabberd sends <stream> element twice due to some reason:

      =INFO REPORT==== 2009-10-12 14:45:46 ===
      I(<0.37.0>:ejabberd_app:69) : ejabberd 3.0.0-alpha is started in the node 'ejabberd_test@ndl-server'
      
      =INFO REPORT==== 2009-10-12 14:45:53 ===
      I(<0.429.0>:ejabberd_listener:224) : (#Port<0.3832>) Accepted connection {{X,X,X,X},48214} -> {{X,X,X,X},6222}
      
      =INFO REPORT==== 2009-10-12 14:45:53 ===
      D(<0.431.0>:ejabberd_receiver:314) : Received XML on stream = <<"
      <stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:client\" to=\"ndl-server\">">>
      
      =INFO REPORT==== 2009-10-12 14:45:53 ===
      D(<0.432.0>:ejabberd_c2s:1324) : Send XML on stream = 
      <?xml version='1.0'?>
      <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
       id='1933525314' from='ndl-server' xml:lang='en'>
      
      =INFO REPORT==== 2009-10-12 14:45:53 ===
      D(<0.431.0>:ejabberd_receiver:314) : Received XML on stream = <<"
      <iq xmlns=\"jabber:client\" type=\"get\" id=\"auth-641481217\" to=\"ndl-server\">
      <query xmlns=\"jabber:iq:auth\"><username>client</username>
      </query>
      </iq>">>
      
      =INFO REPORT==== 2009-10-12 14:45:53 ===
      D(<0.431.0>:shaper:61) : State: {maxrate,1000,0,1255347953125451}, Size=143
      M=71.5, I=19.98
      
      
      =INFO REPORT==== 2009-10-12 14:45:53 ===
      D(<0.432.0>:ejabberd_c2s:1324) : Send XML on stream = 
      <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"
       from="ndl-server" id="1933525314" xml:lang="en">
      
      =INFO REPORT==== 2009-10-12 14:45:53 ===
      D(<0.432.0>:ejabberd_c2s:1324) : Send XML on stream = 
      <iq type="result" id="auth-641481217" from="ndl-server">
      <query xmlns="jabber:iq:auth"><username>client</username><password/><digest/><resource/>
      </query>
      </iq>
      

      The following change fixed the issue for me:

      Index: ejabberd_c2s.erl
      ===================================================================
      --- ejabberd_c2s.erl    (revision 2653)
      +++ ejabberd_c2s.erl    (working copy)
      @@ -1371,7 +1371,8 @@
                                  Server,
                                  VersionStr,
                                  LangStr]),
      -    send_text(StateData, Header).
      +    %send_text(StateData, Header).
      +    send_text(StateData, "<?xml version='1.0'?>").
      
       send_trailer(StateData) when StateData#state.xml_socket ->
           (StateData#state.sockmod):send_xml(
      

      This is most likely wrong fix, though - but I do not understand the logic behind stream setup in ejabberd enough to provide the right one.

        Activity

        Hide
        mremond@process-one.net Mickaël Rémond added a comment -

        Hello,

        This version is not ready, even for testing and we do not support it yet.

        Show
        mremond@process-one.net Mickaël Rémond added a comment - Hello, This version is not ready, even for testing and we do not support it yet.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development