1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

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>
This commit is contained in:
Andrew Bartlett
2019-04-04 17:25:30 +13:00
parent fd74b63144
commit 00b9a97706
2 changed files with 67 additions and 22 deletions

View File

@ -72,7 +72,8 @@ struct ldapsrv_call {
struct ldap_message *msg;
DATA_BLOB blob;
} *replies;
struct iovec out_iov;
struct iovec *out_iov;
size_t iov_count;
struct tevent_req *(*wait_send)(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,