# How big the kernel's receive buffer should be.
#
# recv_buff = 1048576
+
+ #
+ # Maximum number of updates to have outstanding
+ # When this number is reached, no more are read, potentially
+ # causing the receive buffer to fill which will cause the
+ # change notifications to queue up on the LDAP server
+ #
+# max_outstanding = 65536
}
#
* Network tunable parameters
*/
{ FR_CONF_OFFSET_IS_SET("recv_buff", FR_TYPE_UINT32, proto_ldap_sync_ldap_t, recv_buff) },
+ { FR_CONF_OFFSET("max_outstanding", FR_TYPE_UINT32, proto_ldap_sync_ldap_t, max_outstanding), .dflt = "65536" },
CONF_PARSER_TERMINATOR
};
fr_assert(conn);
+ /*
+ * If there are already too many outstanding requests just return.
+ * This will (potentially) cause the TCP buffer to fill and push the
+ * backpressure back to the LDAP server.
+ */
+ if (fr_network_listen_outstanding(thread->nr, li) >= thread->inst->max_outstanding) return 0;
+
tree = talloc_get_type_abort(conn->uctx, fr_rb_tree_t);
/*
uint32_t recv_buff; //!< How big the kernel's recive buffer should be
bool recv_buff_is_set; //!< Whether we were provided with a recv_buff
+
+ uint32_t max_outstanding; //!< Maximun number of outstanding packets.
} proto_ldap_sync_ldap_t;
typedef struct {