Browse Source

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

v1
Aeris 4 years ago
parent
commit
60a8a44c1a
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      lib/cryptcheck/tls/xmpp/server.rb

+ 2
- 0
lib/cryptcheck/tls/xmpp/server.rb 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


Loading…
Cancel
Save