The framework stops receiving responses in Renegotiate of XMPPStream.h #81

Closed
cuongthai opened this Issue Jul 20, 2012 · 13 comments

Comments

Projects
None yet
9 participants
@cuongthai
  • Background:
    I'm using XmppFramework to connect with ejabberd server 2.1.11 on Ubuntu (Linux 32 bits).
    Client side : IOS 5. Xcode 4.3.2. MacOS 10.7.4.
  • Bug Description:
    The negotiation process stops at the second negotiation (renegotiation) line 3037 (XMPPStream.m ).
  • The log show:
2012-07-19 12:00:06:468 XMPPStream[49107:3e0b] RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">bm9uY2U9IjIxNTYzMTM4ODEiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
2012-07-19 12:00:06:468 XMPPStream[49107:3e0b] SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Imt3ZWluZXIxIixyZWFsbT0iMjAzLjIwNS4xMC4xMjciLG5vbmNlPSIyMTU2MzEzODgxIixjbm9uY2U9Ijg1RUU5MTczLTQ0RTEtNDNDMS1CNzFBLTY3OEE5NTQ2MjU1MiIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC8yMDMuMjA1LjEwLjEyNyIscmVzcG9uc2U9NzMwZWZjNzUxOWIwNzNiNDEzMGU0NjFjMmVmMjliNmIsY2hhcnNldD11dGYtOA==</response>
2012-07-19 12:00:06:502 XMPPStream[49107:4603] RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD00YzRjMDk4ZGJhYjk2NmNiMTg3MzVhOTMyYTZhMDkxYw==</challenge>
2012-07-19 12:00:06:502 XMPPStream[49107:4603] SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
2012-07-19 12:00:06:854 XMPPStream[49107:4603] RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
2012-07-19 12:00:06:854 XMPPStream[49107:4603] SEND: <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='xxx.xxx.xxx.xxx'>
  • My suggestion:
if (shouldRenegotiate){
  // Now we start our negotiation over again...
  [self sendOpeningNegotiation];
  // I added this line
  [asyncSocket readDataWithTimeout:TIMEOUT_XMPP_READ_STREAM tag:TAG_XMPP_READ_STREAM];
}
@jonasman

This comment has been minimized.

Show comment
Hide comment
@jonasman

jonasman Jul 23, 2012

Yesh, I also had that problem. I had to revert back to my old version!

Yesh, I also had that problem. I had to revert back to my old version!

@bassrock

This comment has been minimized.

Show comment
Hide comment
@bassrock

bassrock Jul 27, 2012

this solution worked for me

this solution worked for me

@shiruba

This comment has been minimized.

Show comment
Hide comment
@shiruba

shiruba Jul 29, 2012

Worked for me, too.

shiruba commented Jul 29, 2012

Worked for me, too.

@halfsoft

This comment has been minimized.

Show comment
Hide comment
@halfsoft

halfsoft Jul 30, 2012

Yes this fixes the problem that I was having.

Yes this fixes the problem that I was having.

@jonasman

This comment has been minimized.

Show comment
Hide comment
@jonasman

jonasman Jul 30, 2012

I confirm as well that this solved my problem

I confirm as well that this solved my problem

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 30, 2012

First time trying out XMPPFramework and had this problem. This snipped fixed the problem for me. Thanks. :)

ghost commented Jul 30, 2012

First time trying out XMPPFramework and had this problem. This snipped fixed the problem for me. Thanks. :)

@robbiehanson

This comment has been minimized.

Show comment
Hide comment
@robbiehanson

robbiehanson Aug 1, 2012

Owner

It seems clear that this is an issue for several people. It's also clear that the proposed solution seems to solve the problem. However, I'm having trouble wrapping my head around the root cause of the problem. I'm investigating when and where [asyncSocket readData...] is called, and don't quite understand why this is needed. According to my (obviously incorrect) understanding, it's getting called in all the right places, and at all the right times.

I'd like to merge this change into master, but I fear this bug is specific to a particular server configuration or xmpp authentication flow. Thus the patch may fix one problem, but cause another (for different configurations / authentications).

Could someone possibly comment out the fix listed above, and then post a full SEND/RECV log from start to hang.

Also, is there anything else unique about the xmppStream configuration? (Using oldSchoolSecureConnect, etc.)

Owner

robbiehanson commented Aug 1, 2012

It seems clear that this is an issue for several people. It's also clear that the proposed solution seems to solve the problem. However, I'm having trouble wrapping my head around the root cause of the problem. I'm investigating when and where [asyncSocket readData...] is called, and don't quite understand why this is needed. According to my (obviously incorrect) understanding, it's getting called in all the right places, and at all the right times.

I'd like to merge this change into master, but I fear this bug is specific to a particular server configuration or xmpp authentication flow. Thus the patch may fix one problem, but cause another (for different configurations / authentications).

Could someone possibly comment out the fix listed above, and then post a full SEND/RECV log from start to hang.

Also, is there anything else unique about the xmppStream configuration? (Using oldSchoolSecureConnect, etc.)

@robbiehanson

This comment has been minimized.

Show comment
Hide comment
@robbiehanson

robbiehanson Aug 2, 2012

Owner

Issue reproduced... Investigating now.

Owner

robbiehanson commented Aug 2, 2012

Issue reproduced... Investigating now.

@robbiehanson

This comment has been minimized.

Show comment
Hide comment
@robbiehanson

robbiehanson Aug 2, 2012

Owner

Closing the issue. Please let me know if you still have issues after the change.

Owner

robbiehanson commented Aug 2, 2012

Closing the issue. Please let me know if you still have issues after the change.

@jonasman

This comment has been minimized.

Show comment
Hide comment
@jonasman

jonasman Aug 3, 2012

I don't know if is is related but some extensions start working when the stream call their didAuthenticate methods, what about if the connection is secured?

Exemple:
XMPPvCardAvatarModule

jonasman commented Aug 3, 2012

I don't know if is is related but some extensions start working when the stream call their didAuthenticate methods, what about if the connection is secured?

Exemple:
XMPPvCardAvatarModule

@tjg184

This comment has been minimized.

Show comment
Hide comment
@tjg184

tjg184 Aug 3, 2012

This fixed my issue as well. Thanks!

tjg184 commented Aug 3, 2012

This fixed my issue as well. Thanks!

@Nishantrios

This comment has been minimized.

Show comment
Hide comment
@Nishantrios

Nishantrios Nov 6, 2014

This solution worked for me. Thanks!

This solution worked for me. Thanks!

@maradkar

This comment has been minimized.

Show comment
Hide comment
@maradkar

maradkar Feb 9, 2015

I have tried with above line of code even then it giving same error please help to solve this issue.
Thanks.

maradkar commented Feb 9, 2015

I have tried with above line of code even then it giving same error please help to solve this issue.
Thanks.

davidchiles pushed a commit to davidchiles/XMPPFramework that referenced this issue Jan 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment