Giter Club home page Giter Club logo

Comments (11)

clone1018 avatar clone1018 commented on May 18, 2024

I'm having the same issue, did you ever figure it out @boopathi ?

from go-xmpp.

clone1018 avatar clone1018 commented on May 18, 2024

cc @mattn

from go-xmpp.

mattn avatar mattn commented on May 18, 2024

What the server do you use?

from go-xmpp.

clone1018 avatar clone1018 commented on May 18, 2024

I'm trying to use it with OpenFire

from go-xmpp.

clone1018 avatar clone1018 commented on May 18, 2024

This is my output

<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="127.0.0.1" id="REDACTED" xml:lang="en" version="1.0">
<stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>
<proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="127.0.0.1" id="REDACTED" xml:lang="en" version="1.0"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>
<challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">REDACTED</challenge>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">REDACTED</success>
</stream:stream>

Then everything stops and it never gets to the go function to read the talk.Recv

from go-xmpp.

dullgiulio avatar dullgiulio commented on May 18, 2024

Can confirm this, I made some changes in my fork[1], but I am not ready to PR yet.

[1] dullgiulio@07352ce

from go-xmpp.

martinhpedersen avatar martinhpedersen commented on May 18, 2024

Is anyone working on this bug?

It looks to me like the io.EOF error from func (*xml.Decoder) Token (indicating end of XML stream) is ignored. It should probably trigger connection re-initiation, or at least cause c.Recv to return io.EOF so it can be handled outside the package.

https://github.com/mattn/go-xmpp/blob/8a80c8abe319ccc0e61b63684158bffd1a61ca5a/xmpp.go#L540

from go-xmpp.

dullgiulio avatar dullgiulio commented on May 18, 2024

Sorry, we stopped using OpenFire and I can't reproduce this any longer.

But wouldn't that line end up in panic(unreacheable) is an EOF is received there?

from go-xmpp.

martinhpedersen avatar martinhpedersen commented on May 18, 2024

https://play.golang.org/p/9FiXqI8F0b

I'm afraid not. Since the type switch below don't catch it (the token t is nil), it will simply continue looping forever.

@mattn - Any interest in accepting a pull request that would expose this error to the c.Recv() caller? I can't understand how ignoring that io.EOF could lead to anything but an unrecoverable failure, but I may of course be missing something here.

@dullgiulio - Out of curiosity, do you know if OpenFire implements XMPP Ping? After enabling this on our ejabberd instance, it looks like we're getting io.UnexpectedEOF instead of a non-responsive Recv() call when the connection is broken.

from go-xmpp.

mattn avatar mattn commented on May 18, 2024

Your patch seems good for me.

from go-xmpp.

martinhpedersen avatar martinhpedersen commented on May 18, 2024

I'm sorry. I was looking at (and linking to) an old blob that.

Commit 9dd92e1 changed the behaviour of this function, so my playground example is no longer valid.

Although the patched version behaves as I suggested (https://play.golang.org/p/FAP7Wa8hll), I still suggest that we remove the err != io.EOF statement. It appears misleading, and may still cause issues (depending on the xml package's behaviour).

I'm sending you a PR in a couple of minutes.

from go-xmpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.