@@ -256,7 +256,7 @@ static struct dynamic_ref *
256
256
dom_find_leastconn (VRT_CTX , struct dynamic_domain * dom )
257
257
{
258
258
struct dynamic_ref * next , * best_next ;
259
- unsigned most_connections_available ;
259
+ int most_connections_available ;
260
260
261
261
CHECK_OBJ_NOTNULL (ctx , VRT_CTX_MAGIC );
262
262
CHECK_OBJ_NOTNULL (dom , DYNAMIC_DOMAIN_MAGIC );
@@ -268,7 +268,7 @@ dom_find_leastconn(VRT_CTX, struct dynamic_domain *dom)
268
268
269
269
next = VTAILQ_FIRST (& dom -> refs );
270
270
best_next = NULL ;
271
- most_connections_available = 0 ;
271
+ most_connections_available = INT_MIN ;
272
272
273
273
do {
274
274
CHECK_OBJ_ORNULL (next , DYNAMIC_REF_MAGIC );
@@ -280,7 +280,7 @@ dom_find_leastconn(VRT_CTX, struct dynamic_domain *dom)
280
280
if (next -> dir != creating && next -> dir != NULL && VRT_Healthy (ctx , next -> dir , NULL )) {
281
281
if (VALID_OBJ ((struct backend * )next -> dir -> priv , BACKEND_MAGIC )) {
282
282
struct backend * be ;
283
- unsigned connections_available ;
283
+ int connections_available ;
284
284
285
285
CAST_OBJ_NOTNULL (be , next -> dir -> priv , BACKEND_MAGIC );
286
286
connections_available = be -> max_connections > 0 ? be -> max_connections - be -> n_conn : - be -> n_conn ;
0 commit comments