This fixes the same problems for paged searches as does
https://github.com/ldapjs/node-ldapjs/pull/610 for unpaged searches.
By passing an EventEmitter via callback there exist cases when events
are emitted before listeners are registered, resulting in missed
events.
The Change turns SearchPager into a CorkedEmitter which is already
used as a solution for non paged searches. Doing so requires the
internal 'search' event to be dropped.
This change adapts a test case originally by László Szűcs (@ifroz).
Signed-off-by: Philippe Seewer <philippe.seewer@bfh.ch>
This fixes a test failure when the host has something listening
on the LDAP TCP port. Previously, the test cases would assume
that the port was free and they would not connect.
For #612
This resolves an issue arising from using both a callback and an EventEmitter
together in the Client.search() API. Since the emitter would only be available
through the callback, some events could be emitted before the callback
is triggered, resulting in missed events.
This change incorporates a test case originally by László Szűcs (@ifroz).
For GH-602
- Use more strict comparisons for client input asserts
- Fix baseObject comparison in SearchRequest initialization
- Alter default error for server route fallthrough
Detecting certain types of errors in encountered during any operation
(such as BusyError or UnavailableError) can be useful for making
client-wide decisions.
Search response objects now include more instrumentation and control when
automatically fetching paged results. See the SearchPager documentation
for more details.
Fixmcavage/node-ldapjs#203
Certain LDAP messages (such as DeleteRequest) encode their contents as
raw bytes within the top-level sequence object. As such, they rely
their length being passed to them when LDAPMessage decodes the sequence.
This was being done incorrectly, but would not manifest itself as a
problem unless controls followed the message. If no controls were
present, then length of the sequence item was bounded by the message
itself and the parse would succeed.
Fixmcavage/node-ldapjs#212
The pooled client would automatically bind when initializing connections
if bindDN and bindCredentials were passed to during construction.
This convenience should be supported in the plain client too.
Abandon handling is not within spec in the ldapjs server and not
particularly robust in the client. This test should be re-enabled when
both issues are fixed.