mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-28 04:10:34 +05:00
tpws: disable simultaneous use of oob and disorder in BSD systems
This commit is contained in:
parent
42090daf24
commit
4d47749e7c
24
tpws/tpws.c
24
tpws/tpws.c
@ -499,6 +499,16 @@ void config_from_file(const char *filename)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __linux__
|
||||||
|
static bool check_oob_disorder(const struct desync_profile *dp)
|
||||||
|
{
|
||||||
|
return !(
|
||||||
|
dp->oob && (dp->disorder || dp->disorder_http || dp->disorder_tls) ||
|
||||||
|
dp->oob_http && (dp->disorder || dp->disorder_http) ||
|
||||||
|
dp->oob_tls && (dp->disorder || dp->disorder_tls));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void parse_params(int argc, char *argv[])
|
void parse_params(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
@ -840,6 +850,13 @@ void parse_params(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
dp->disorder = true;
|
dp->disorder = true;
|
||||||
|
#ifndef __linux__
|
||||||
|
if (!check_oob_disorder(dp))
|
||||||
|
{
|
||||||
|
DLOG_ERR("--oob and --disorder work simultaneously only in linux. in this system it's guaranteed to fail.\n");
|
||||||
|
exit_clean(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 28: /* oob */
|
case 28: /* oob */
|
||||||
if (optarg)
|
if (optarg)
|
||||||
@ -854,6 +871,13 @@ void parse_params(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
dp->oob = true;
|
dp->oob = true;
|
||||||
|
#ifndef __linux__
|
||||||
|
if (!check_oob_disorder(dp))
|
||||||
|
{
|
||||||
|
DLOG_ERR("--oob and --disorder work simultaneously only in linux. in this system it's guaranteed to fail.\n");
|
||||||
|
exit_clean(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 29: /* oob-data */
|
case 29: /* oob-data */
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user