Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blather does not gracefully handle server-side error on connect #70

Open
bklang opened this issue Nov 4, 2011 · 3 comments
Open

Blather does not gracefully handle server-side error on connect #70

bklang opened this issue Nov 4, 2011 · 3 comments
Assignees
Labels
Milestone

Comments

@bklang
Copy link
Member

bklang commented Nov 4, 2011

Following is an example (very short) session where the XMPP server is unable to handle a new connection. Blather received an Internal Server Error with text "Can't find application for stream message" from the server. Instead of passing up some kind of Internal Server Error exception, Blather tells the server that the XML it received was not well formed.

Client (Blather)
<stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en' >

Server
<stream:error><internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-streams"/><text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-streams">Can't find application for stream message.</text></stream:error></stream:stream>

Client
<stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream><stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>

Server
</stream:stream>

Client
<stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>

@benlangfeld
Copy link
Member

This is because a ParseError is being raised. I'll run this through the parser later on to figure out why it's invalid, because I'm not quite seeing it right now.

@benlangfeld
Copy link
Member

Can you give steps to reproduce? I'm struggling to get it to break the parser manually and I'm starting to suspect it might be a weird encoding issue. Alternatively, inspecting the ParseError here might be nice: https://github.com/sprsquish/blather/blob/develop/lib/blather/stream.rb#L157

@bklang
Copy link
Member Author

bklang commented Nov 7, 2011

I am able to reproduce it using netcat. I start a fake "server" with nc -l 5222 which opens a simple TCP listener on port 5222. Then I run my Blather client to connect to that server. When Blather connects I see the stream request come in and I paste the first Server response listed above. The exact same error results.

@ghost ghost assigned benlangfeld Nov 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants