]> git.sur5r.net Git - openldap/commitdiff
ITS#8118 dosearch: flush stdout
authorThomas Cort <linuxgeek@gmail.com>
Wed, 29 Apr 2015 17:33:53 +0000 (13:33 -0400)
committerHoward Chu <hyc@openldap.org>
Wed, 29 Apr 2015 19:01:03 +0000 (20:01 +0100)
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 the stdio buffer fills (8192 bytes
for example). This can leave the tail end of persistent search results
in the buffer for a long time (until enough output has accumulated).

Explicitly call flush so that the output is immediately available.

clients/tools/ldapsearch.c

index 862c9dde885dbd1219b61fd0c226aa88cd4fe519..0fe59edd368a6baee2e3f00e6101a8f98bd21bad 100644 (file)
@@ -1547,6 +1547,7 @@ static int dosearch(
                }
 
                ldap_msgfree( res );
+               fflush( stdout );
        }
 
 done: