mirror of
https://github.com/hufrea/byedpi.git
synced 2025-01-03 04:49:47 +00:00
Remove unnecessary checks
This commit is contained in:
parent
7e52ce9abf
commit
6efcafaf53
36
extend.c
36
extend.c
@ -224,24 +224,22 @@ 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 = ¶ms.dp[m];
|
struct desync_params *dp = ¶ms.dp[m];
|
||||||
if (!dp->detect) {
|
if (!dp->detect) {
|
||||||
m = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (dp->detect & DETECT_TORST) {
|
if (!(dp->detect & DETECT_TORST)) {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
if (can_reconn) {
|
||||||
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) {
|
|
||||||
return reconnect(pool, val, m);
|
return reconnect(pool, val, m);
|
||||||
}
|
}
|
||||||
else mode_add_get(
|
mode_add_get(
|
||||||
(struct sockaddr_ina *)&val->in6, m);
|
(struct sockaddr_ina *)&val->in6, m);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m >= params.dp_count && m > 1) {
|
||||||
|
mode_add_get(
|
||||||
|
(struct sockaddr_ina *)&val->in6, 0);
|
||||||
}
|
}
|
||||||
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,
|
||||||
@ -263,18 +261,8 @@ int on_fin(struct poolhd *pool, struct eval *val)
|
|||||||
if (!can_reconn && params.auto_level <= AUTO_NOSAVE) {
|
if (!can_reconn && params.auto_level <= AUTO_NOSAVE) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
bool ssl_err = 0;
|
|
||||||
|
|
||||||
if (can_reconn) {
|
if (!(val->pair->mark && val->round_count <= 1)) {
|
||||||
char *req = val->pair->buff.data;
|
|
||||||
ssize_t qn = val->pair->buff.size;
|
|
||||||
|
|
||||||
ssl_err = is_tls_chello(req, qn);
|
|
||||||
}
|
|
||||||
else if (val->pair->mark && val->round_count <= 1) {
|
|
||||||
ssl_err = 1;
|
|
||||||
}
|
|
||||||
if (!ssl_err) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
for (; m < params.dp_count; m++) {
|
for (; m < params.dp_count; m++) {
|
||||||
@ -355,7 +343,7 @@ ssize_t on_first_send(struct eval *client, char *buffer, ssize_t n, ssize_t bfsi
|
|||||||
LOG(LOG_E, "drop connection (m=%d)\n", m);
|
LOG(LOG_E, "drop connection (m=%d)\n", m);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (params.auto_level > AUTO_NOSAVE && params.dp_count > 1) {
|
if (params.auto_level > AUTO_NOBUFF && params.dp_count > 1) {
|
||||||
client->mark = is_tls_chello(buffer, n);
|
client->mark = is_tls_chello(buffer, n);
|
||||||
}
|
}
|
||||||
client->attempt = m;
|
client->attempt = m;
|
||||||
|
Loading…
Reference in New Issue
Block a user