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>
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