rst if exist only one group

This commit is contained in:
ruti 2024-09-24 04:59:19 +03:00
parent dca3b5693a
commit e406476610

View File

@ -223,21 +223,24 @@ int on_torst(struct poolhd *pool, struct eval *val)
for (; m < params.dp_count; m++) { for (; m < params.dp_count; m++) {
struct desync_params *dp = &params.dp[m]; struct desync_params *dp = &params.dp[m];
if (!dp->detect) { if (!dp->detect) {
return -1; m = 0;
break;
} }
if (dp->detect & DETECT_TORST) { if (dp->detect & DETECT_TORST) {
break; break;
} }
} }
if (m >= params.dp_count) { if (m == 0) {
}
else if (m >= params.dp_count) {
if (m > 1) mode_add_get( if (m > 1) mode_add_get(
(struct sockaddr_ina *)&val->in6, 0); (struct sockaddr_ina *)&val->in6, 0);
} }
else if (can_reconn) else if (can_reconn) {
return reconnect(pool, val, m); return reconnect(pool, val, m);
else }
mode_add_get( else mode_add_get(
(struct sockaddr_ina *)&val->in6, m); (struct sockaddr_ina *)&val->in6, m);
} }
struct linger l = { .l_onoff = 1 }; struct linger l = { .l_onoff = 1 };
if (setsockopt(val->pair->fd, SOL_SOCKET, if (setsockopt(val->pair->fd, SOL_SOCKET,