mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 18:45:40 +08:00
parentretries command added
This commit is contained in:
parent
1f2bdd7b80
commit
cbe0c2f511
14
src/auth.c
14
src/auth.c
@ -605,7 +605,6 @@ void trafcountfunc(struct clientparam *param){
|
|||||||
pthread_mutex_lock(&tc_mutex);
|
pthread_mutex_lock(&tc_mutex);
|
||||||
for(tc = conf.trafcounter; tc; tc = tc->next) {
|
for(tc = conf.trafcounter; tc; tc = tc->next) {
|
||||||
if(ACLmatches(tc->ace, param)){
|
if(ACLmatches(tc->ace, param)){
|
||||||
time_t t;
|
|
||||||
|
|
||||||
if(tc->ace->action == NOCOUNTIN) {
|
if(tc->ace->action == NOCOUNTIN) {
|
||||||
countout = 1;
|
countout = 1;
|
||||||
@ -622,7 +621,6 @@ void trafcountfunc(struct clientparam *param){
|
|||||||
}
|
}
|
||||||
if(countout) for(tc = conf.trafcounter; tc; tc = tc->next) {
|
if(countout) for(tc = conf.trafcounter; tc; tc = tc->next) {
|
||||||
if(ACLmatches(tc->ace, param)){
|
if(ACLmatches(tc->ace, param)){
|
||||||
time_t t;
|
|
||||||
if(tc->ace->action == NOCOUNTOUT || tc->ace->action == NOCOUNTALL) break;
|
if(tc->ace->action == NOCOUNTOUT || tc->ace->action == NOCOUNTALL) break;
|
||||||
if(tc->ace->action != COUNTOUT && tc->ace->action != COUNTALL ) {
|
if(tc->ace->action != COUNTOUT && tc->ace->action != COUNTALL ) {
|
||||||
continue;
|
continue;
|
||||||
@ -699,6 +697,7 @@ int checkACL(struct clientparam * param){
|
|||||||
param->weight = acentry->weight;
|
param->weight = acentry->weight;
|
||||||
if(acentry->action == 2) {
|
if(acentry->action == 2) {
|
||||||
struct ace dup;
|
struct ace dup;
|
||||||
|
int res=60,i=0;
|
||||||
|
|
||||||
if(param->operation < 256 && !(param->operation & CONNECT)){
|
if(param->operation < 256 && !(param->operation & CONNECT)){
|
||||||
continue;
|
continue;
|
||||||
@ -706,8 +705,17 @@ int checkACL(struct clientparam * param){
|
|||||||
if(param->redirected && acentry->chains && SAISNULL(&acentry->chains->addr) && !*SAPORT(&acentry->chains->addr)) {
|
if(param->redirected && acentry->chains && SAISNULL(&acentry->chains->addr) && !*SAPORT(&acentry->chains->addr)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(param->remsock != INVALID_SOCKET) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for(; i < conf.parentretries; i++){
|
||||||
dup = *acentry;
|
dup = *acentry;
|
||||||
return handleredirect(param, &dup);
|
res = handleredirect(param, &dup);
|
||||||
|
if(!res) break;
|
||||||
|
if(param->remsock != INVALID_SOCKET) closesocket(param->remsock);
|
||||||
|
param->remsock = INVALID_SOCKET;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
return acentry->action;
|
return acentry->action;
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ struct extparam conf = {
|
|||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
0, -1, 0, 0, 0, 0,
|
0, -1, 0, 0, 0, 0,
|
||||||
0, 500, 0, 0, 0, 0, 0,
|
0, 500, 0, 0, 0, 0, 0, 2,
|
||||||
6, 600,
|
6, 600,
|
||||||
1048576,
|
1048576,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
|
12
src/conf.c
12
src/conf.c
@ -624,6 +624,15 @@ static int h_nscache(int argc, unsigned char **argv){
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int h_parentretries(int argc, unsigned char **argv){
|
||||||
|
int res;
|
||||||
|
|
||||||
|
res = atoi((char *)argv[1]);
|
||||||
|
if(res > 0) conf.parentretries = res;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int h_nscache6(int argc, unsigned char **argv){
|
static int h_nscache6(int argc, unsigned char **argv){
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
@ -1572,8 +1581,9 @@ struct commands commandhandlers[]={
|
|||||||
{commandhandlers+60, "stacksize", h_stacksize, 2, 2},
|
{commandhandlers+60, "stacksize", h_stacksize, 2, 2},
|
||||||
{commandhandlers+61, "force", h_force, 1, 1},
|
{commandhandlers+61, "force", h_force, 1, 1},
|
||||||
{commandhandlers+62, "noforce", h_noforce, 1, 1},
|
{commandhandlers+62, "noforce", h_noforce, 1, 1},
|
||||||
|
{commandhandlers+63, "parentretries", h_parentretries, 2, 2},
|
||||||
#ifndef NORADIUS
|
#ifndef NORADIUS
|
||||||
{commandhandlers+63, "radius", h_radius, 3, 0},
|
{commandhandlers+64, "radius", h_radius, 3, 0},
|
||||||
#endif
|
#endif
|
||||||
{specificcommands, "", h_noop, 1, 0}
|
{specificcommands, "", h_noop, 1, 0}
|
||||||
};
|
};
|
||||||
|
@ -572,7 +572,7 @@ struct extparam {
|
|||||||
struct srvparam *services;
|
struct srvparam *services;
|
||||||
int stacksize,
|
int stacksize,
|
||||||
threadinit, counterd, haveerror, rotate, paused, archiverc,
|
threadinit, counterd, haveerror, rotate, paused, archiverc,
|
||||||
demon, maxchild, needreload, timetoexit, version, noforce, bandlimver;
|
demon, maxchild, needreload, timetoexit, version, noforce, bandlimver, parentretries;
|
||||||
int authcachetype, authcachetime;
|
int authcachetype, authcachetime;
|
||||||
int filtermaxsize;
|
int filtermaxsize;
|
||||||
unsigned char *logname, **archiver;
|
unsigned char *logname, **archiver;
|
||||||
|
Loading…
Reference in New Issue
Block a user