From: Ondřej Kuzník Date: Wed, 10 May 2017 15:06:19 +0000 (+0100) Subject: Round-robin for upstream connections X-Git-Tag: OPENLDAP_REL_ENG_2_5_1ALPHA~18^2~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e65cd38787fe95856e233103d08f3ee4122a095a;p=thirdparty%2Fopenldap.git Round-robin for upstream connections --- diff --git a/servers/lloadd/backend.c b/servers/lloadd/backend.c index b1ad7a3119..7e2fc76f72 100644 --- a/servers/lloadd/backend.c +++ b/servers/lloadd/backend.c @@ -128,9 +128,16 @@ backend_select( Operation *op ) "selected connection %lu for client %lu msgid=%d\n", c->c_connid, op->o_client_connid, op->o_client_msgid ); + /* + * Round-robin step: + * Rotate the queue to put this connection at the end. + */ + LDAP_CIRCLEQ_MAKE_TAIL( head, c, c_next ); + b->b_n_ops_executing++; c->c_n_ops_executing++; CONNECTION_UNLOCK_INCREF(c); + ldap_pvt_thread_mutex_unlock( &b->b_mutex ); return c; }