mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-24 02:02:53 +08:00
More generically parse proxy chain type
This commit is contained in:
parent
ea4ca0a6b2
commit
1ac3334e99
@ -50,7 +50,8 @@ typedef enum {
|
|||||||
DYNAMIC_TYPE,
|
DYNAMIC_TYPE,
|
||||||
STRICT_TYPE,
|
STRICT_TYPE,
|
||||||
RANDOM_TYPE,
|
RANDOM_TYPE,
|
||||||
ROUND_ROBIN_TYPE
|
ROUND_ROBIN_TYPE,
|
||||||
|
MAX_CHAIN_TYPE
|
||||||
} chain_type;
|
} chain_type;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -330,17 +330,14 @@ static void get_chain_data(proxy_chain_list *pc_list) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int get_chain_type(char *buff, chain_type *ct) {
|
int get_chain_type(char *buff, chain_type *ct) {
|
||||||
if(strstr(buff, "random_chain"))
|
int i = 0;
|
||||||
*ct = RANDOM_TYPE;
|
for (; i < MAX_CHAIN_TYPE; i++) {
|
||||||
else if(strstr(buff, "strict_chain"))
|
if (strstr(buff, chain_type_strmap[i])) {
|
||||||
*ct = STRICT_TYPE;
|
*ct = i;
|
||||||
else if(strstr(buff, "dynamic_chain"))
|
return 0;
|
||||||
*ct = DYNAMIC_TYPE;
|
}
|
||||||
else if(strstr(buff, "round_robin_chain"))
|
}
|
||||||
*ct = ROUND_ROBIN_TYPE;
|
return 1;
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int proxy_chain_list_load(proxy_chain_list *pc_list) {
|
int proxy_chain_list_load(proxy_chain_list *pc_list) {
|
||||||
|
Loading…
Reference in New Issue
Block a user