mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2025-12-31 11:45:49 +03:00
removed duplicated code in args.c
This commit is contained in:
12
args.c
12
args.c
@@ -163,7 +163,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
} else if (strcmp(optarg, "none") == 0) {
|
} else if (strcmp(optarg, "none") == 0) {
|
||||||
config.fragmentation_strategy = FRAG_STRAT_NONE;
|
config.fragmentation_strategy = FRAG_STRAT_NONE;
|
||||||
} else {
|
} else {
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,7 +174,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
config.frag_sni_faked = 0;
|
config.frag_sni_faked = 0;
|
||||||
} else {
|
} else {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +185,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
config.frag_sni_reverse = 0;
|
config.frag_sni_reverse = 0;
|
||||||
} else {
|
} else {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +196,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
config.faking_strategy = FAKE_STRAT_TTL;
|
config.faking_strategy = FAKE_STRAT_TTL;
|
||||||
} else {
|
} else {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +203,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
case OPT_FAKING_TTL:
|
case OPT_FAKING_TTL:
|
||||||
num = parse_numeric_option(optarg);
|
num = parse_numeric_option(optarg);
|
||||||
if (errno != 0 || num < 0 || num > 255) {
|
if (errno != 0 || num < 0 || num > 255) {
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +216,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
config.fake_sni = 0;
|
config.fake_sni = 0;
|
||||||
} else {
|
} else {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +223,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
case OPT_FAKE_SNI_SEQ_LEN:
|
case OPT_FAKE_SNI_SEQ_LEN:
|
||||||
num = parse_numeric_option(optarg);
|
num = parse_numeric_option(optarg);
|
||||||
if (errno != 0 || num < 0 || num > 255) {
|
if (errno != 0 || num < 0 || num > 255) {
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +231,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
case OPT_FK_WINSIZE:
|
case OPT_FK_WINSIZE:
|
||||||
num = parse_numeric_option(optarg);
|
num = parse_numeric_option(optarg);
|
||||||
if (errno != 0 || num < 0) {
|
if (errno != 0 || num < 0) {
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +239,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
case OPT_SEG2DELAY:
|
case OPT_SEG2DELAY:
|
||||||
num = parse_numeric_option(optarg);
|
num = parse_numeric_option(optarg);
|
||||||
if (errno != 0 || num < 0) {
|
if (errno != 0 || num < 0) {
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +247,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
case OPT_THREADS:
|
case OPT_THREADS:
|
||||||
num = parse_numeric_option(optarg);
|
num = parse_numeric_option(optarg);
|
||||||
if (errno != 0 || num < 0 || num > MAX_THREADS) {
|
if (errno != 0 || num < 0 || num > MAX_THREADS) {
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +255,6 @@ int parse_args(int argc, char *argv[]) {
|
|||||||
case OPT_QUEUE_NUM:
|
case OPT_QUEUE_NUM:
|
||||||
num = parse_numeric_option(optarg);
|
num = parse_numeric_option(optarg);
|
||||||
if (errno != 0 || num < 0) {
|
if (errno != 0 || num < 0) {
|
||||||
printf("Invalid option %s\n", long_opt[optIdx].name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,6 +273,7 @@ out:
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
return 1;
|
return 1;
|
||||||
error:
|
error:
|
||||||
|
printf("Invalid option %s\n", long_opt[optIdx].name);
|
||||||
print_usage(argv[0]);
|
print_usage(argv[0]);
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user