mirror of
https://github.com/hufrea/byedpi.git
synced 2025-03-29 04:39:14 +03:00
parent
9318e90e4e
commit
bbe9522242
1 changed files with 9 additions and 6 deletions
15
extend.c
15
extend.c
|
@ -212,7 +212,7 @@ static bool check_proto_tcp(int proto, char *buffer, ssize_t n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool check_round(int nr[2], int r)
|
static bool check_round(int *nr, int r)
|
||||||
{
|
{
|
||||||
return (!nr[1] && r <= 1) || (r >= nr[0] && r <= nr[1]);
|
return (!nr[1] && r <= 1) || (r >= nr[0] && r <= nr[1]);
|
||||||
}
|
}
|
||||||
|
@ -505,11 +505,14 @@ ssize_t tcp_recv_hook(struct poolhd *pool, struct eval *val,
|
||||||
val->round_count++;
|
val->round_count++;
|
||||||
val->pair->round_sent = 0;
|
val->pair->round_sent = 0;
|
||||||
}
|
}
|
||||||
if (val->flag == FLAG_CONN
|
if (val->flag == FLAG_CONN && !val->round_sent) {
|
||||||
&& check_round(
|
int *nr = params.dp[val->pair->attempt].rounds;
|
||||||
params.dp[val->pair->attempt].rounds, val->round_count)
|
|
||||||
&& cancel_setup(val)) {
|
if (check_round(nr, val->round_count)
|
||||||
return -1;
|
&& !check_round(nr, val->round_count + 1)
|
||||||
|
&& cancel_setup(val)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue