blather 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/blather/stream.rb +1 -1
- data/lib/blather/stream/features/sasl.rb +8 -1
- metadata +2 -2
data/lib/blather/stream.rb
CHANGED
@@ -80,7 +80,7 @@ module Blather
|
|
80
80
|
# Called by EM with data from the wire
|
81
81
|
def receive_data(data) # :nodoc:
|
82
82
|
Blather.logger.debug "\n#{'-'*30}\n"
|
83
|
-
Blather.logger.debug "
|
83
|
+
Blather.logger.debug "STREAM IN: #{data}"
|
84
84
|
@parser << data
|
85
85
|
|
86
86
|
rescue ParseError => e
|
@@ -6,6 +6,12 @@ class Stream # :nodoc:
|
|
6
6
|
register :sasl_unknown_mechanism
|
7
7
|
end
|
8
8
|
|
9
|
+
MECHANISMS = %w[
|
10
|
+
digest-md5
|
11
|
+
plain
|
12
|
+
anonymous
|
13
|
+
].freeze
|
14
|
+
|
9
15
|
SASL_NS = 'urn:ietf:params:xml:ns:xmpp-sasl'.freeze
|
10
16
|
register SASL_NS
|
11
17
|
|
@@ -20,7 +26,8 @@ class Stream # :nodoc:
|
|
20
26
|
@node = stanza
|
21
27
|
case stanza.element_name
|
22
28
|
when 'mechanisms'
|
23
|
-
|
29
|
+
available_mechanisms = stanza.children.map { |m| m.content.downcase }
|
30
|
+
@mechanisms = MECHANISMS.select { |m| available_mechanisms.include? m }
|
24
31
|
next!
|
25
32
|
when 'failure'
|
26
33
|
next!
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Smick
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-30 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|