Sha256: a6681ec3631a95fbc67a42b31a92a2f90b6c8c97341626d7f74dab63080167a3

Contents?: true

Size: 628 Bytes

Versions: 3

Compression:

Stored size: 628 Bytes

Contents

module NetLdapPatches
  module Connection
    module NextMsgid
      INITIAL_MSGID_ENV_VAR = 'NET_LDAP_INITIAL_MSGID'
      def next_msgid
        # avoids using the msgid range 128-255 by starting the msgid counter at 300
        # otherwise certain versions and/or configurations of Microsoft's Active Directory will
        # return Error Searching: invalid response-type in search: 24 and halt the mirroring process
        @msgid ||= ENV.key?(INITIAL_MSGID_ENV_VAR) ? ENV[INITIAL_MSGID_ENV_VAR].to_i : 300
        @msgid += 1
      end
    end
  end
end

Net::LDAP::Connection.prepend NetLdapPatches::Connection::NextMsgid

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
socialcast-1.4.4 lib/net_ldap_patches/connection/next_msgid.rb
socialcast-1.4.3 lib/net_ldap_patches/connection/next_msgid.rb
socialcast-1.4.2 lib/net_ldap_patches/connection/next_msgid.rb