]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Split client/upstream PDU size limits
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 13 Jun 2017 18:32:35 +0000 (19:32 +0100)
committerOndřej Kuzník <okuznik@symas.com>
Tue, 17 Nov 2020 17:55:46 +0000 (17:55 +0000)
doc/man/man5/lloadd.conf.5
servers/lloadd/client.c
servers/lloadd/config.c
servers/lloadd/connection.c
servers/lloadd/proto-slap.h
servers/lloadd/slap.h
servers/lloadd/upstream.c

index 7a6f96ccc4a18c05c0dd242b64277548aa42cb33..4392d53f40a02af6c5ef5f1453e94465e242f144 100644 (file)
@@ -251,12 +251,13 @@ The (absolute) name of a file that will hold the
 server's process ID (see
 .BR getpid (2)).
 .TP
-.B sockbuf_max_incoming <integer>
-Specify the maximum incoming LDAP PDU size for anonymous sessions.
+.B sockbuf_max_incoming_client <integer>
+Specify the maximum LDAP PDU size accepted coming from clients.
 The default is 262143.
 .TP
-.B sockbuf_max_incoming_auth <integer>
-Specify the maximum incoming LDAP PDU size for authenticated sessions.
+.B sockbuf_max_incoming_upstream <integer>
+Specify the maximum LDAP PDU size accepted coming from upstream
+connections.
 The default is 4194303.
 .TP
 .B tcp-buffer [listener=<URL>] [{read|write}=]<size>
index 6e290d8f9177f4b367670fa57e339479fbe8296c..8063eb987a8ddd27c38a9e5edf6fdee33305bb65 100644 (file)
@@ -268,6 +268,11 @@ client_init(
 
     c = connection_init( s, peername, flags );
 
+    {
+        ber_len_t max = sockbuf_max_incoming_client;
+        ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max );
+    }
+
     c->c_state = SLAP_C_READY;
 
     event = event_new( base, s, EV_READ|EV_PERSIST, client_read_cb, c );
index 96571c6322c00ba6fe134b49719c2b4d31cb0556..5e9af80730155f472d96249b6e9b69146dc2958d 100644 (file)
@@ -71,8 +71,8 @@ static char *logfileName;
 
 lload_features_t lload_features;
 
-ber_len_t sockbuf_max_incoming = SLAP_SB_MAX_INCOMING_DEFAULT;
-ber_len_t sockbuf_max_incoming_auth = SLAP_SB_MAX_INCOMING_AUTH;
+ber_len_t sockbuf_max_incoming_client = SLAP_SB_MAX_INCOMING_CLIENT;
+ber_len_t sockbuf_max_incoming_upstream = SLAP_SB_MAX_INCOMING_UPSTREAM;
 
 int slap_conn_max_pdus_per_cycle = SLAP_CONN_MAX_PDUS_PER_CYCLE_DEFAULT;
 
@@ -203,13 +203,13 @@ static ConfigTable config_back_cf_table[] = {
         ARG_MAGIC,
         &config_restrict,
     },
-    { "sockbuf_max_incoming", "max", 2, 2, 0,
+    { "sockbuf_max_incoming_client", "max", 2, 2, 0,
         ARG_BER_LEN_T,
-        &sockbuf_max_incoming,
+        &sockbuf_max_incoming_client,
     },
-    { "sockbuf_max_incoming_auth", "max", 2, 2, 0,
+    { "sockbuf_max_incoming_upstream", "max", 2, 2, 0,
         ARG_BER_LEN_T,
-        &sockbuf_max_incoming_auth,
+        &sockbuf_max_incoming_upstream,
     },
     { "tcp-buffer", "[listener=<listener>] [{read|write}=]size", 0, 0, 0,
 #ifdef LDAP_TCP_BUFFER
index 9174412d6b271a938c02e92c518285cf4334ce70..d8d46a5a89626209ea63cb44800e3984f91d0f9d 100644 (file)
@@ -107,11 +107,6 @@ connection_init( ber_socket_t s, const char *peername, int flags )
     c->c_sb = ber_sockbuf_alloc();
     ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_FD, &s );
 
-    {
-        ber_len_t max = sockbuf_max_incoming;
-        ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max );
-    }
-
 #ifdef LDAP_PF_LOCAL
     if ( flags & CONN_IS_IPC ) {
 #ifdef LDAP_DEBUG
index 69796dc60714203a139e75324a9f24f8aaf5a913..bcad45dcc5c8a81c93278a61d3bc3fdb9447172f 100644 (file)
@@ -227,8 +227,8 @@ LDAP_SLAPD_F (int) slap_zn_wlock( void *, void * );
 LDAP_SLAPD_F (int) slap_zn_wunlock( void *, void * );
 #endif
 
-LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming;
-LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming_auth;
+LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming_client;
+LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming_upstream;
 LDAP_SLAPD_V (int) slap_conn_max_pdus_per_cycle;
 
 LDAP_SLAPD_V (lload_features_t) lload_features;
index 8bd08b3d58e798db5c602510a9384b9f260eb7fa..a3193eb3aa7b7a151e4d9b89f37989085b86226d 100644 (file)
@@ -84,8 +84,8 @@ LDAP_BEGIN_DECL
 
 #define SLAP_MAX_WORKER_THREADS ( 16 )
 
-#define SLAP_SB_MAX_INCOMING_DEFAULT ( ( 1 << 18 ) - 1 )
-#define SLAP_SB_MAX_INCOMING_AUTH ( ( 1 << 24 ) - 1 )
+#define SLAP_SB_MAX_INCOMING_CLIENT ( ( 1 << 18 ) - 1 )
+#define SLAP_SB_MAX_INCOMING_UPSTREAM ( ( 1 << 24 ) - 1 )
 
 #define SLAP_CONN_MAX_PDUS_PER_CYCLE_DEFAULT 10
 
index 4b57f30f17f08bae8c23b8aca330b6d7b281e913..9cc551da32407a2130b0eb396a2f618f8442d90d 100644 (file)
@@ -818,6 +818,11 @@ upstream_init( ber_socket_t s, Backend *b )
     c = connection_init( s, b->b_host, flags );
     c->c_private = b;
 
+    {
+        ber_len_t max = sockbuf_max_incoming_upstream;
+        ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max );
+    }
+
     event = event_new( base, s, EV_WRITE, upstream_write_cb, c );
     if ( !event ) {
         Debug( LDAP_DEBUG_ANY, "upstream_init: "