lib/net/ldap/pdu.rb
##
# Per RFC 2251, an LDAP "control" is a sequence of tuples, each consisting
# of an OID, a boolean criticality flag defaulting FALSE, and an OPTIONAL
# Octet String. If only two fields are given, the second one may be either
# criticality or data, since criticality has a default value. Someday we
# may want to come back here and add support for some of more-widely used
# controls. RFC-2696 is a good example.
Per RFC 2251, an LDAP "control" is a sequence of tuples, each consisting
of an OID, a boolean criticality flag defaulting FALSE, and an OPTIONAL
Octet String. If only two fields are given, the second one may be either
criticality or data, since criticality has a default value. Someday we
may want to come back here and add support for some of more-widely used
controls. RFC-2696 is a good example.
Per RFC 2251 an LDAP " control " is a sequence of tuples each consisting of an OID a boolean criticality flag defaulting FALSE and an OPTIONAL Octet String . If only two fields are given the second one may be either criticality or data since criticality has a default value . Someday we may want to come back here and add support for some of more - widely used controls . RFC - 2696 is a good example .
def parse_controls(sequence)
    @ldap_controls = sequence.map do |control|
      o = OpenStruct.new
      o.oid, o.criticality, o.value = control[0], control[1], control[2]
      if o.criticality and o.criticality.is_a?(String)
        o.value = o.criticality
        o.criticality = false
      end
      o
    end
  end
def parse_controls ( sequence ) @ldap_controls = sequence . map do | control | o = OpenStruct . new o . oid , o . criticality , o . value = control [ 0 ] , control [ 1 ] , control [ 2 ] if o . criticality and o . criticality . is_a? ( String ) o . value = o . criticality o . criticality = false end o end end
Per RFC 2251, an LDAP "control" is a sequence of tuples, each consisting
of an OID, a boolean criticality flag defaulting FALSE, and an OPTIONAL
Octet String.
Per RFC 2251 an LDAP " control " is a sequence of tuples each consisting of an OID a boolean criticality flag defaulting FALSE and an OPTIONAL Octet String .
sequence
<not_specific>