From e4064766101ea3b5fc6ddde4f335a3ec57ce8368 Mon Sep 17 00:00:00 2001 From: ruti <> Date: Tue, 24 Sep 2024 04:59:19 +0300 Subject: [PATCH] rst if exist only one group --- extend.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/extend.c b/extend.c index c696cbe..9010234 100644 --- a/extend.c +++ b/extend.c @@ -223,21 +223,24 @@ int on_torst(struct poolhd *pool, struct eval *val) for (; m < params.dp_count; m++) { struct desync_params *dp = ¶ms.dp[m]; if (!dp->detect) { - return -1; + m = 0; + break; } if (dp->detect & DETECT_TORST) { break; } } - if (m >= params.dp_count) { + if (m == 0) { + } + else if (m >= params.dp_count) { if (m > 1) mode_add_get( (struct sockaddr_ina *)&val->in6, 0); } - else if (can_reconn) + else if (can_reconn) { return reconnect(pool, val, m); - else - mode_add_get( - (struct sockaddr_ina *)&val->in6, m); + } + else mode_add_get( + (struct sockaddr_ina *)&val->in6, m); } struct linger l = { .l_onoff = 1 }; if (setsockopt(val->pair->fd, SOL_SOCKET,