Module: Net::LDAP::Connection::SynchronousRead

Defined in:
lib/rex/proto/ldap.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#read(length = nil, opts = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rex/proto/ldap.rb', line 8

def read(length = nil, opts = {})
  data = ''
  loop do
    chunk = super(length - data.length)
    if chunk.nil?
      return data == '' ? nil : data
    end

    data << chunk
    break if data.length == length
  end

  data
end