diff --git a/src/auto.c b/src/auto.c index cfdd45a..9d94a1a 100644 --- a/src/auto.c +++ b/src/auto.c @@ -22,8 +22,15 @@ void * autochild(struct clientparam* param) { param->res = 801; dolog(param, (unsigned char *)""); } - if(*param->clibuf == 4 || *param->clibuf == 5) return sockschild(param); - if(*param->clibuf == 22) return tlsprchild(param); + if(*param->clibuf == 4 || *param->clibuf == 5) { + param->service = S_SOCKS; + return sockschild(param); + } + if(*param->clibuf == 22) { + param->service = S_TLSPR; + return tlsprchild(param); + } + param->service = S_PROXY; return proxychild(param); } diff --git a/src/log.c b/src/log.c index abeea86..7a7b161 100644 --- a/src/log.c +++ b/src/log.c @@ -190,7 +190,7 @@ int dobuf2(struct clientparam * param, unsigned char * buf, const unsigned char break; case 'N': - if(param->service < 15) { + if(param->service <= MAX_SERVICE) { len = (conf.stringtable)? (int)strlen((char *)conf.stringtable[SERVICES + param->service]) : 0; if(len > 20) len = 20; memcpy(buf+i, (len)?conf.stringtable[SERVICES + param->service]:(unsigned char*)"-", (len)?len:1); diff --git a/src/stringtable.c b/src/stringtable.c index e9330c1..7ca393c 100644 --- a/src/stringtable.c +++ b/src/stringtable.c @@ -28,9 +28,9 @@ unsigned char * strings[] = { /* 15 */ (unsigned char *)"DNSPR", /* 16 */ (unsigned char *)"FTPPR", /* 17 */ (unsigned char *)"SMTPP", -/* 18 */ (unsigned char *)"ZOMBIE", -/* 19 */ NULL, -/* 20 */ NULL, +/* 18 */ (unsigned char *)"AUTO", +/* 19 */ (unsigned char *)"TLSPR", +/* 20 */ (unsigned char *)"ZOMBIE", /* 21 */ NULL, /* 22 */ NULL, /* 23 */ NULL, diff --git a/src/structures.h b/src/structures.h index 786d301..cade344 100644 --- a/src/structures.h +++ b/src/structures.h @@ -181,13 +181,14 @@ typedef enum { S_DNSPR, S_FTPPR, S_SMTPP, - S_REVLI, - S_REVCO, - S_ZOMBIE, S_AUTO, - S_TLSPR + S_TLSPR, + S_ZOMBIE }PROXYSERVICE; +#define MAX_SERVICE S_ZOMBIE + + struct clientparam; struct node; struct symbol;