mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-24 02:55:40 +08:00
Support for 'extip' and 'smtp' parent types added
This commit is contained in:
parent
9db88313c7
commit
3cc9796583
11
src/auth.c
11
src/auth.c
@ -241,7 +241,10 @@ int handleredirect(struct clientparam * param, struct ace * acentry){
|
||||
r2 = (myrand(param, sizeof(struct clientparam))%1000);
|
||||
}
|
||||
if(!connected){
|
||||
if(SAISNULL(&cur->addr) && !*SAPORT(&cur->addr)){
|
||||
if(cur->type == R_EXTIP){
|
||||
memcpy(¶m->sinsl, &cur->addr, sizeof(cur->addr));
|
||||
}
|
||||
else if(SAISNULL(&cur->addr) && !*SAPORT(&cur->addr)){
|
||||
if(cur->extuser){
|
||||
if(param->extusername)
|
||||
myfree(param->extusername);
|
||||
@ -266,11 +269,9 @@ int handleredirect(struct clientparam * param, struct ace * acentry){
|
||||
case R_ICQ:
|
||||
param->redirectfunc = icqprchild;
|
||||
break;
|
||||
/*
|
||||
case R_MSN:
|
||||
param->redirectfunc = msnprchild;
|
||||
case R_SMTP:
|
||||
param->redirectfunc = smtppchild;
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
param->redirectfunc = proxychild;
|
||||
}
|
||||
|
10
src/common.c
10
src/common.c
@ -674,12 +674,14 @@ int doconnect(struct clientparam * param){
|
||||
}
|
||||
#endif
|
||||
|
||||
if(SAISNULL(¶m->sinsl)){
|
||||
#ifndef NOIPV6
|
||||
if(*SAFAMILY(¶m->sinsr) == AF_INET6) memcpy(¶m->sinsl, ¶m->srv->extsa6, sizeof(param->srv->extsa6));
|
||||
else
|
||||
if(*SAFAMILY(¶m->sinsr) == AF_INET6) memcpy(¶m->sinsl, ¶m->srv->extsa6, sizeof(param->srv->extsa6));
|
||||
else
|
||||
#endif
|
||||
memcpy(¶m->sinsl, ¶m->srv->extsa, sizeof(param->srv->extsa));
|
||||
*SAPORT(¶m->sinsl) = 0;
|
||||
memcpy(¶m->sinsl, ¶m->srv->extsa, sizeof(param->srv->extsa));
|
||||
*SAPORT(¶m->sinsl) = 0;
|
||||
}
|
||||
if(so._bind(param->remsock, (struct sockaddr*)¶m->sinsl, SASIZE(¶m->sinsl))==-1) {
|
||||
return 12;
|
||||
}
|
||||
|
@ -705,7 +705,8 @@ static int h_parent(int argc, unsigned char **argv){
|
||||
else if(!strcmp((char *)argv[2], "ftp"))chains->type = R_FTP;
|
||||
else if(!strcmp((char *)argv[2], "admin"))chains->type = R_ADMIN;
|
||||
else if(!strcmp((char *)argv[2], "icq"))chains->type = R_ICQ;
|
||||
else if(!strcmp((char *)argv[2], "msn"))chains->type = R_MSN;
|
||||
else if(!strcmp((char *)argv[2], "extip"))chains->type = R_EXTIP;
|
||||
else if(!strcmp((char *)argv[2], "smtp"))chains->type = R_SMTP;
|
||||
else {
|
||||
fprintf(stderr, "Chaining error: bad chain type (%s)\n", argv[2]);
|
||||
return(4);
|
||||
|
@ -751,9 +751,9 @@ void srvinit2(struct srvparam * srv, struct clientparam *param){
|
||||
memcpy(¶m->sincr, &srv->intsa, sizeof(param->sincr));
|
||||
memcpy(¶m->sincl, &srv->intsa, sizeof(param->sincl));
|
||||
#ifndef NOIPV6
|
||||
memcpy(¶m->sinsr, (srv->family == 6 || srv->family == 64)? (void *)&srv->extsa6: (void *)&srv->extsa, sizeof(param->sinsl));
|
||||
memcpy(¶m->sinsr, (srv->family == 6 || srv->family == 64)? (void *)&srv->extsa6: (void *)&srv->extsa, sizeof(param->sinsr));
|
||||
#else
|
||||
memcpy(¶m->sinsr, &srv->extsa, sizeof(param->sinsl));
|
||||
memcpy(¶m->sinsr, &srv->extsa, sizeof(param->sinsr));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,7 @@ typedef enum {
|
||||
R_SOCKS5,
|
||||
R_HTTP,
|
||||
R_POP3,
|
||||
R_SMTP,
|
||||
R_FTP,
|
||||
R_CONNECTP,
|
||||
R_SOCKS4P,
|
||||
@ -225,7 +226,7 @@ typedef enum {
|
||||
R_SOCKS5B,
|
||||
R_ADMIN,
|
||||
R_ICQ,
|
||||
R_MSN
|
||||
R_EXTIP
|
||||
} REDIRTYPE;
|
||||
|
||||
struct chain {
|
||||
|
Loading…
Reference in New Issue
Block a user