Connection disconnects with error “internal error”

2019-09-14 00:43发布

问题:

I am using XMPPFramework to connect to my xmpp server on local network ,it connects but as soon as it sends the auth packet and recieves challenge it disconnects with error : "internal error" code=1 ErrorDomain=libxmlErrorDomain. Basically it is not able to parse the challenge :

2013-03-08 15:56:41.890 iPhoneXMPP[23710:13703] Data to be parsed <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImluZm9zeXMuY29tIixub25jZT0ib05JYmxSU2hLQXUxWnorRUNGbmRJby83Snljdm5DLzNKQWV2SXB5UCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
2013-03-08 15:56:41.891 iPhoneXMPP[23710:13703] Parser failed

How can i solve this issue,is it something related to how i have configured my xcode to work with libxml2 ?

回答1:

There was a extra charcter at the end of each packet,due to which the SAX parser libxml2 was failing.trimming each packet by one character solved the problem.