Module: NetLdapPatches::Connection::NextMsgid

Defined in:
lib/net_ldap_patches/connection/next_msgid.rb

Constant Summary collapse

INITIAL_MSGID_ENV_VAR =
'NET_LDAP_INITIAL_MSGID'

Instance Method Summary collapse

Instance Method Details

#next_msgidObject



5
6
7
8
9
10
11
# File 'lib/net_ldap_patches/connection/next_msgid.rb', line 5

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