Skip to content

Commit c16ae11

Browse files
mtoddJohn Wedoff
authored andcommitted
Extract read_ber_id
1 parent 9daa954 commit c16ae11

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/net/ber/ber_parser.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def read_ber(syntax = nil)
166166
# from streams that don't block when we ask for more data (like
167167
# StringIOs). At it is, this can throw TypeErrors and other nasties.
168168

169-
id = getbyte or return nil # don't trash this value, we'll use it later
169+
id = read_ber_id or return nil # don't trash this value, we'll use it later
170170
content_length = read_ber_length
171171

172172
yield id, content_length if block_given?
@@ -179,4 +179,9 @@ def read_ber(syntax = nil)
179179

180180
parse_ber_object(syntax, id, data)
181181
end
182+
183+
# Internal: Returns the BER message ID or nil.
184+
def read_ber_id
185+
getbyte
186+
end
182187
end

0 commit comments

Comments
 (0)