Knot::Protocol: Fix iteration.
This commit is contained in:
parent
88e38eab7a
commit
0282694a28
|
@ -164,9 +164,9 @@ class Knot::Protocol
|
|||
sock = StringIO.new s
|
||||
sock.write [1].pack( 'c')
|
||||
data[:flags] ||= ''
|
||||
Idx::Idx.each_with_index do |n, i|
|
||||
v = data[n]&.to_s
|
||||
sock.write [0x10+i, v.size, v].pack( 'c na*') if v
|
||||
Idx::Idx.each do |n|
|
||||
v = data[n.to_sym]&.to_s&.b
|
||||
sock.write [n.to_i, v.size, v].pack( 'c na*') if v
|
||||
end
|
||||
sock.write [3].pack( 'c')
|
||||
sock.flush
|
||||
|
|
Loading…
Reference in a new issue