Browse Source

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

v1
Aeris 7 years ago
parent
commit
60a8a44c1a
  1. 2
      lib/cryptcheck/tls/xmpp/server.rb

2
lib/cryptcheck/tls/xmpp/server.rb

@ -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

Loading…
Cancel
Save