ldap_server: Use an array of struct iovec to avoid data_blob_append()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 4 Apr 2019 04:25:30 +0000 (17:25 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 20 May 2019 04:01:11 +0000 (04:01 +0000)
commit00b9a97706e71e6834781df0a144f23af9526689
tree50522fc43d90c4c7e9588c648afee2cc330f174b
parentfd74b6314444ff8f1da8fcd8d540a2e88b7b872c
ldap_server: Use an array of struct iovec to avoid data_blob_append()

This avoids a the implicit 256MB limit on LDAP replies (allowing this
to be increased in the future) and means we copy less memory around.

However because we can only have 1024 entries in a struct iovec (on Linux)
we will need to call tstream_writev_queue_send() multiple times.

Calling it in chunks of 1024 seems a reasonable compromise, the
gensec layer will chunk it out smaller if required.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/ldap_server/ldap_server.c
source4/ldap_server/ldap_server.h