mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-10 15:10:11 +08:00
Fix warnings
This commit is contained in:
parent
1233e05263
commit
47ee1e5e77
@ -527,7 +527,7 @@ for(;;){
|
|||||||
}
|
}
|
||||||
else if(param->ndatfilterscli > 0 && contentlength64 > 0){
|
else if(param->ndatfilterscli > 0 && contentlength64 > 0){
|
||||||
uint64_t newlen64;
|
uint64_t newlen64;
|
||||||
newlen64 = sockfillbuffcli(param, (unsigned long)contentlength64, CONNECTION_S);
|
newlen64 = (uint64_t) sockfillbuffcli(param, (unsigned long)contentlength64, CONNECTION_S);
|
||||||
if(newlen64 == contentlength64) {
|
if(newlen64 == contentlength64) {
|
||||||
action = handledatfltcli(param, ¶m->clibuf, (int *)¶m->clibufsize, 0, (int *)¶m->cliinbuf);
|
action = handledatfltcli(param, ¶m->clibuf, (int *)¶m->clibufsize, 0, (int *)¶m->cliinbuf);
|
||||||
if(action == HANDLED){
|
if(action == HANDLED){
|
||||||
|
|||||||
@ -164,8 +164,8 @@ int sockrecvfrom(struct clientparam *param, SOCKET sock, struct sockaddr * sin,
|
|||||||
|
|
||||||
int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec);
|
int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec);
|
||||||
int sockgetcharsrv(struct clientparam * param, int timeosec, int timeousec);
|
int sockgetcharsrv(struct clientparam * param, int timeosec, int timeousec);
|
||||||
int sockfillbuffcli(struct clientparam * param, unsigned long size, int timeosec);
|
unsigned long sockfillbuffcli(struct clientparam * param, unsigned long size, int timeosec);
|
||||||
int sockfillbuffsrv(struct clientparam * param, unsigned long size, int timeosec);
|
unsigned long sockfillbuffsrv(struct clientparam * param, unsigned long size, int timeosec);
|
||||||
|
|
||||||
int sockgetlinebuf(struct clientparam * param, DIRECTION which, unsigned char * buf, int bufsize, int delim, int to);
|
int sockgetlinebuf(struct clientparam * param, DIRECTION which, unsigned char * buf, int bufsize, int delim, int to);
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,7 @@ int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec){
|
|||||||
return (int)*param->clibuf;
|
return (int)*param->clibuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sockfillbuffcli(struct clientparam * param, unsigned long size, int timeosec){
|
unsigned long sockfillbuffcli(struct clientparam * param, unsigned long size, int timeosec){
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if(!param->clibuf) return 0;
|
if(!param->clibuf) return 0;
|
||||||
@ -107,7 +107,7 @@ int sockfillbuffcli(struct clientparam * param, unsigned long size, int timeosec
|
|||||||
return param->cliinbuf;
|
return param->cliinbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sockfillbuffsrv(struct clientparam * param, unsigned long size, int timeosec){
|
unsigned long sockfillbuffsrv(struct clientparam * param, unsigned long size, int timeosec){
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if(!param->srvbuf) return 0;
|
if(!param->srvbuf) return 0;
|
||||||
|
|||||||
30
src/tlspr.c
30
src/tlspr.c
@ -70,7 +70,7 @@ int parsehello(int type, unsigned char *hello, unsigned len, char *sni, int * sn
|
|||||||
offset += 2;
|
offset += 2;
|
||||||
if(elen+offset != len) return -9;
|
if(elen+offset != len) return -9;
|
||||||
while(elen > 1){
|
while(elen > 1){
|
||||||
int xlen;
|
unsigned xlen;
|
||||||
xlen = size16(hello+offset+2);
|
xlen = size16(hello+offset+2);
|
||||||
if(xlen+4 > elen) return -10;
|
if(xlen+4 > elen) return -10;
|
||||||
if(type == 1 && hello[offset] == 0 && hello[offset+1] == 0){
|
if(type == 1 && hello[offset] == 0 && hello[offset+1] == 0){
|
||||||
@ -108,8 +108,8 @@ int parsehello(int type, unsigned char *hello, unsigned len, char *sni, int * sn
|
|||||||
return snifound;
|
return snifound;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tlstobufcli(struct clientparam *param, int offset){
|
int tlstobufcli(struct clientparam *param){
|
||||||
int len, newlen;
|
unsigned long len, newlen;
|
||||||
if(!param->clibuf){
|
if(!param->clibuf){
|
||||||
if(!(param->clibuf = myalloc(SRVBUFSIZE))) return -1;
|
if(!(param->clibuf = myalloc(SRVBUFSIZE))) return -1;
|
||||||
param->clibufsize = SRVBUFSIZE;
|
param->clibufsize = SRVBUFSIZE;
|
||||||
@ -135,11 +135,11 @@ int tlstobufcli(struct clientparam *param, int offset){
|
|||||||
if(param->cliinbuf <= newlen) return -5;
|
if(param->cliinbuf <= newlen) return -5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return len;
|
return (int)len;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tlstobufsrv(struct clientparam *param, int offset){
|
int tlstobufsrv(struct clientparam *param){
|
||||||
int len, newlen;
|
unsigned long len, newlen;
|
||||||
|
|
||||||
if(param->cliinbuf != param->clioffset){
|
if(param->cliinbuf != param->clioffset){
|
||||||
len = socksend(param, param->remsock, param->clibuf+param->clioffset,param->cliinbuf-param->clioffset, conf.timeouts[STRING_S]);
|
len = socksend(param, param->remsock, param->clibuf+param->clioffset,param->cliinbuf-param->clioffset, conf.timeouts[STRING_S]);
|
||||||
@ -153,20 +153,20 @@ int tlstobufsrv(struct clientparam *param, int offset){
|
|||||||
param->srvbufsize = SRVBUFSIZE;
|
param->srvbufsize = SRVBUFSIZE;
|
||||||
param->srvoffset = param->srvinbuf = 0;
|
param->srvoffset = param->srvinbuf = 0;
|
||||||
}
|
}
|
||||||
len = sockfillbuffsrv(param, offset+5, conf.timeouts[STRING_S]);
|
len = sockfillbuffsrv(param, 5, conf.timeouts[STRING_S]);
|
||||||
if(len < offset+5) return -3;
|
if(len < 5) return -3;
|
||||||
if(param->srvbuf[offset+1] != 3) {
|
if(param->srvbuf[1] != 3) {
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
len = offset + 5 + size16(param->srvbuf+offset+3);
|
len = 5 + size16(param->srvbuf+3);
|
||||||
if(len > param->srvbufsize) return -5;
|
if(len > param->srvbufsize) return -5;
|
||||||
for(newlen=param->srvinbuf; newlen < len; newlen=param->srvinbuf){
|
for(newlen=param->srvinbuf; newlen < len; newlen=param->srvinbuf){
|
||||||
sockfillbuffsrv(param, len, conf.timeouts[STRING_S]);
|
sockfillbuffsrv(param, len, conf.timeouts[STRING_S]);
|
||||||
if(param->srvinbuf <= newlen) return -6;
|
if(param->srvinbuf <= newlen) return -6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return len-offset;
|
return (int)len;
|
||||||
}
|
}
|
||||||
|
|
||||||
void * tlsprchild(struct clientparam* param) {
|
void * tlsprchild(struct clientparam* param) {
|
||||||
@ -177,7 +177,7 @@ void * tlsprchild(struct clientparam* param) {
|
|||||||
char proto[PROTOLEN]="-";
|
char proto[PROTOLEN]="-";
|
||||||
int snipos = 0;
|
int snipos = 0;
|
||||||
|
|
||||||
res = tlstobufcli(param, 0);
|
res = tlstobufcli(param);
|
||||||
if(res <= 0 || param->clibuf[0] != 22){
|
if(res <= 0 || param->clibuf[0] != 22){
|
||||||
if(param->srv->requirecert)RETURN(300-res);
|
if(param->srv->requirecert)RETURN(300-res);
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ void * tlsprchild(struct clientparam* param) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(param->srv->requirecert > 1){
|
if(param->srv->requirecert > 1){
|
||||||
res = tlstobufsrv(param, 0);
|
res = tlstobufsrv(param);
|
||||||
if(res <= 0 || param->srvbuf[0] != 22) RETURN(340-res);
|
if(res <= 0 || param->srvbuf[0] != 22) RETURN(340-res);
|
||||||
lv = param->srvbuf[2];
|
lv = param->srvbuf[2];
|
||||||
res = parsehello(2, param->srvbuf, (unsigned)res, sni, &snipos, &lv, proto);
|
res = parsehello(2, param->srvbuf, (unsigned)res, sni, &snipos, &lv, proto);
|
||||||
@ -234,7 +234,7 @@ void * tlsprchild(struct clientparam* param) {
|
|||||||
len = param->srvinbuf;
|
len = param->srvinbuf;
|
||||||
if(socksend(param, param->clisock, param->srvbuf,len, conf.timeouts[STRING_S]) != len) RETURN(371);
|
if(socksend(param, param->clisock, param->srvbuf,len, conf.timeouts[STRING_S]) != len) RETURN(371);
|
||||||
param->srvinbuf = 0;
|
param->srvinbuf = 0;
|
||||||
res = tlstobufsrv(param, 0);
|
res = tlstobufsrv(param);
|
||||||
if(res <= 0) RETURN(380-res);
|
if(res <= 0) RETURN(380-res);
|
||||||
if(param->srvbuf[0]!= 22) break;
|
if(param->srvbuf[0]!= 22) break;
|
||||||
switch(param->srvbuf[5]){
|
switch(param->srvbuf[5]){
|
||||||
@ -256,7 +256,7 @@ void * tlsprchild(struct clientparam* param) {
|
|||||||
if(param->srv->requirecert > 3){
|
if(param->srv->requirecert > 3){
|
||||||
if(!reqcert) RETURN(374);
|
if(!reqcert) RETURN(374);
|
||||||
for(done=0;!done;) {
|
for(done=0;!done;) {
|
||||||
res = tlstobufcli(param, 0);
|
res = tlstobufcli(param);
|
||||||
if(res <= 0) RETURN(390-res);
|
if(res <= 0) RETURN(390-res);
|
||||||
len = res;
|
len = res;
|
||||||
if(param->clibuf[0]!= 22) break;
|
if(param->clibuf[0]!= 22) break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user