linuxgeek@gmail.com wrote:
Full_Name: Thomas Cort Version: HEAD OS: Mac OS X 10.10.3 URL: ftp://ftp.openldap.org/incoming/thomas-cort-150429.patch Submission from: (NULL) (96.46.34.154)
The LDIF output wasn't being explicitly flushed. In certain scenarios, such as piping the output of a persistent ldapsearch to node.js v0.12 on Mac OS X 10.10.3, the output is unavailable to the process consuming the search results until some operating system limit is reached (8192 bytes for example) and it is automatically flushed. This can leave the tail end of persistent search results in an operating system buffer for a long time (until enough output has accumulated for the OS to flush it).
Explicitly call flush so that the output is immediately available.
That totally defeats the purpose of using stdio - which is, to generate buffered output and avoid excessive numbers of system calls.
Rejecting this patch. A more suitable patch might be one that flushes once when all currently available messages have been processed in ldapsearch.c. I.e., after the for-loop in dosearch() completes.
I uploaded the patch to ftp.openldap.org as thomas-cort-150429.patch
The attached patch file is derived from OpenLDAP Software. All of the modifications to OpenLDAP Software represented in the following patch(es) were developed by Thomas Cort linuxgeek@gmail.com. I have not assigned rights and/or interest in this work to any party.
I, Thomas Cort, hereby place the following modifications to OpenLDAP Software (and only these modifications) into the public domain. Hence, these modifications may be freely used and/or redistributed for any purpose with or without attribution and/or other notice.