Skip to content

Commit 3b8cd7b

Browse files
committed
Extract read_ber_id
1 parent 7a60375 commit 3b8cd7b

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
@@ -157,7 +157,7 @@ def read_ber(syntax = nil)
157157
# from streams that don't block when we ask for more data (like
158158
# StringIOs). At it is, this can throw TypeErrors and other nasties.
159159

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

163163
yield id, content_length if block_given?
@@ -170,4 +170,9 @@ def read_ber(syntax = nil)
170170

171171
parse_ber_object(syntax, id, data)
172172
end
173+
174+
# Internal: Returns the BER message ID or nil.
175+
def read_ber_id
176+
getbyte
177+
end
173178
end

0 commit comments

Comments
 (0)