.B lloadd
backend servers in any way.
+.SH CN=MONITOR INTERFACE
+As part of
+.BR lloadd 's
+.B cn=monitor
+interface it is possible to close a client connection it manages by writing to
+the corresponding entry,
+.B replacing
+the
+.B olmConnectionState
+attribute with the value
+.BR closing .
+This is subject to ACLs configured on the monitor database. The server will
+send a
+.B Notice of Disconnection
+to the client, refuse any new operations and once all pending operations have
+finished, close the connection.
+
+For example, to close connection number 42:
+
+.LP
+.nf
+.ft tt
+ dn: cn=connection 42,cn=incoming connections,cn=load balancer,cn=backends,cn=monitor
+ changetype: modify
+ replace: olmConnectionState
+ olmConnectionState: closing
+.ft
+.fi
+
.SH EXAMPLES
To start
.I lloadd
return rc;
}
+static int
+lload_monitor_conn_modify( Operation *op, SlapReply *rs, Entry *e, void *priv )
+{
+ Modifications *m;
+ LloadConnection *c = priv;
+
+ for ( m = op->orm_modlist; m; m = m->sml_next ) {
+ struct berval closing = BER_BVC("closing");
+ int gentle = 1;
+
+ if ( m->sml_flags & SLAP_MOD_INTERNAL ) continue;
+
+ if ( m->sml_desc != ad_olmConnectionState ||
+ m->sml_op != LDAP_MOD_REPLACE || m->sml_numvals != 1 ||
+ ber_bvcmp( &m->sml_nvalues[0], &closing ) ) {
+ return LDAP_OTHER;
+ }
+
+ if ( lload_connection_close( c, &gentle ) ) {
+ return LDAP_OTHER;
+ }
+ }
+ return SLAP_CB_CONTINUE;
+}
+
/*
* Monitor cache is locked, the connection cannot be unlinked and freed under us.
* That also means we need to unlock and finish as soon as possible.
cb = ch_calloc( sizeof(monitor_callback_t), 1 );
cb->mc_update = lload_monitor_conn_update;
+ cb->mc_modify = lload_monitor_conn_modify;
cb->mc_private = c;
attr_merge_one( e, ad_olmConnectionType, &value, NULL );