Fix hang if XMPP server answers with error (unknown vhost)

v1
Aeris 2015-09-09 21:39:08 +02:00
parent 4b680c6eec
commit 60a8a44c1a
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ module CryptCheck
loop do
response += socket.recv 1024
xml = ::Nokogiri::XML response
error = xml.xpath '//stream:error'
raise Exception, error.text unless error.empty?
unless xml.xpath('//stream:features').empty?
response = xml
break