mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c20a04b752 | ||
|
|
3f859fdb11 | ||
|
|
556681a829 | ||
|
|
ee0bb55c06 | ||
|
|
2c0bc19f75 | ||
|
|
286aa51e78 | ||
|
|
145eb580e4 | ||
|
|
46211c26d2 | ||
|
|
e0262c23b0 | ||
|
|
7f80f4f958 | ||
|
|
6a54b37181 | ||
|
|
c0bb608acc | ||
|
|
4631335aca | ||
|
|
94c58b3db4 | ||
|
|
d75dcf0b54 | ||
|
|
28581b1738 |
No files matched your search
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION 0,8,8,0
|
FILEVERSION 0,8,10,0
|
||||||
PRODUCTVERSION 0,8,8,0
|
PRODUCTVERSION 0,8,10,0
|
||||||
FILETYPE 1
|
FILETYPE 1
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
BEGIN
|
BEGIN
|
||||||
@@ -14,12 +14,12 @@ BEGIN
|
|||||||
VALUE "Comments", "3proxy - tiny proxy server, http://3proxy.ru/\0"
|
VALUE "Comments", "3proxy - tiny proxy server, http://3proxy.ru/\0"
|
||||||
VALUE "CompanyName", "Vladimir Dubrovin\0"
|
VALUE "CompanyName", "Vladimir Dubrovin\0"
|
||||||
VALUE "FileDescription", "3proxy - tiny proxy server\0"
|
VALUE "FileDescription", "3proxy - tiny proxy server\0"
|
||||||
VALUE "FileVersion", "0.8.8\0"
|
VALUE "FileVersion", "0.8.10\0"
|
||||||
VALUE "InternalName", "3proxy\0"
|
VALUE "InternalName", "3proxy\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2002-2016 Vladimir Dubrovin\0"
|
VALUE "LegalCopyright", "Copyright (C) 2002-2017 Vladimir Dubrovin\0"
|
||||||
VALUE "OriginalFilename", "3proxy.exe\0"
|
VALUE "OriginalFilename", "3proxy.exe\0"
|
||||||
VALUE "ProductName", "3proxy\0"
|
VALUE "ProductName", "3proxy\0"
|
||||||
VALUE "ProductVersion", "0.8.8\0"
|
VALUE "ProductVersion", "0.8.10\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
|||||||
service
|
service
|
||||||
# service is required under NT if you want 3proxy to start as service
|
# service is required under NT if you want 3proxy to start as service
|
||||||
|
|
||||||
#log /usr/local/etc/3proxy/logs/3proxy.log D
|
#log /var/log/3proxy/log D
|
||||||
log c:\3proxy\logs\3proxy.log D
|
log c:\3proxy\logs\3proxy.log D
|
||||||
# log allows to specify log file location and rotation, D means logfile
|
# log allows to specify log file location and rotation, D means logfile
|
||||||
# is created daily
|
# is created daily
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ monitor /usr/local/etc/3proxy/counters
|
|||||||
monitor /usr/local/etc/3proxy/passwd
|
monitor /usr/local/etc/3proxy/passwd
|
||||||
monitor /usr/local/etc/3proxy/bandlimiters
|
monitor /usr/local/etc/3proxy/bandlimiters
|
||||||
|
|
||||||
log /usr/local/etc/3proxy/log/log D
|
log /var/log/3proxy/log D
|
||||||
rotate 60
|
rotate 60
|
||||||
counter /usr/local/etc/3proxy/3proxy.3cf
|
counter /usr/local/etc/3proxy/3proxy.3cf
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -19,10 +19,9 @@ int clientnegotiate(struct chain * redir, struct clientparam * param, struct soc
|
|||||||
|
|
||||||
user = redir->extuser;
|
user = redir->extuser;
|
||||||
pass = redir->extpass;
|
pass = redir->extpass;
|
||||||
if (param->srvinbuf < 4096){
|
if (!param->srvbufsize){
|
||||||
if(param->srvbuf)myfree(param->srvbuf);
|
param->srvbufsize = SRVBUFSIZE;
|
||||||
param->srvbuf = myalloc(4096);
|
param->srvbuf = myalloc(param->srvbufsize);
|
||||||
param->srvbufsize = 4096;
|
|
||||||
}
|
}
|
||||||
buf = param->srvbuf;
|
buf = param->srvbuf;
|
||||||
username = buf + 2048;
|
username = buf + 2048;
|
||||||
@@ -486,8 +485,14 @@ unsigned bandlimitfunc(struct clientparam *param, unsigned nbytesin, unsigned nb
|
|||||||
|
|
||||||
if(!nbytesin && !nbytesout) return 0;
|
if(!nbytesin && !nbytesout) return 0;
|
||||||
pthread_mutex_lock(&bandlim_mutex);
|
pthread_mutex_lock(&bandlim_mutex);
|
||||||
if(param->paused != conf.paused){
|
if(param->paused != conf.paused && param->bandlimver != conf.paused){
|
||||||
return (1);
|
if(!conf.bandlimfunc){
|
||||||
|
param->bandlimfunc = NULL;
|
||||||
|
pthread_mutex_unlock(&bandlim_mutex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
initbandlims(param);
|
||||||
|
param->bandlimver = conf.paused;
|
||||||
}
|
}
|
||||||
for(i=0; nbytesin&& i<MAXBANDLIMS && param->bandlims[i]; i++){
|
for(i=0; nbytesin&& i<MAXBANDLIMS && param->bandlims[i]; i++){
|
||||||
if( !param->bandlims[i]->basetime ||
|
if( !param->bandlims[i]->basetime ||
|
||||||
@@ -784,10 +789,14 @@ int dnsauth(struct clientparam * param){
|
|||||||
((u&0xFF000000)>>24));
|
((u&0xFF000000)>>24));
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!udpresolve(*SAFAMILY(¶m->sincr), (unsigned char *)buf, (unsigned char *)addr, NULL, param, 1)) return 6;
|
if(!udpresolve(*SAFAMILY(¶m->sincr), (unsigned char *)buf, (unsigned char *)addr, NULL, param, 1)) {
|
||||||
if(!memcmp(SAADDR(¶m->sincr), addr, SAADDRLEN(¶m->sincr))) return 6;
|
return 3;
|
||||||
|
}
|
||||||
|
if(memcmp(SAADDR(¶m->sincr), addr, SAADDRLEN(¶m->sincr))) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
return param->username? 0:4;
|
return param->username? 0:3;
|
||||||
}
|
}
|
||||||
|
|
||||||
int strongauth(struct clientparam * param){
|
int strongauth(struct clientparam * param){
|
||||||
|
|||||||
+3
-4
@@ -468,7 +468,7 @@ int dobuf2(struct clientparam * param, unsigned char * buf, const unsigned char
|
|||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
len = param->hostname? (int)strlen((char *)param->hostname) : 0;
|
len = param->hostname? (int)strlen((char *)param->hostname) : 0;
|
||||||
if (len > 0 && !strchr((char *)param->hostname, ':')) for(len = 0; param->hostname[len] && i < 4000; len++, i++){
|
if (len > 0 && !strchr((char *)param->hostname, ':')) for(len = 0; param->hostname[len] && i < 256; len++, i++){
|
||||||
buf[i] = param->hostname[len];
|
buf[i] = param->hostname[len];
|
||||||
if(param->srv->nonprintable && (buf[i] < 0x20 || strchr((char *)param->srv->nonprintable, buf[i]))) buf[i] = param->srv->replace;
|
if(param->srv->nonprintable && (buf[i] < 0x20 || strchr((char *)param->srv->nonprintable, buf[i]))) buf[i] = param->srv->replace;
|
||||||
if(doublec && strchr((char *)doublec, buf[i])) {
|
if(doublec && strchr((char *)doublec, buf[i])) {
|
||||||
@@ -480,7 +480,6 @@ int dobuf2(struct clientparam * param, unsigned char * buf, const unsigned char
|
|||||||
buf[i++] = '[';
|
buf[i++] = '[';
|
||||||
i += myinet_ntop(*SAFAMILY(¶m->req), SAADDR(¶m->req), (char *)buf + i, 64);
|
i += myinet_ntop(*SAFAMILY(¶m->req), SAADDR(¶m->req), (char *)buf + i, 64);
|
||||||
buf[i++] = ']';
|
buf[i++] = ']';
|
||||||
buf[i++] = 0;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -651,8 +650,8 @@ int doconnect(struct clientparam * param){
|
|||||||
SASIZETYPE size;
|
SASIZETYPE size;
|
||||||
|
|
||||||
|
|
||||||
if (*SAFAMILY(¶m->sincr) == *SAFAMILY(¶m->req) && !memcmp(SAADDR(¶m->sincr), SAADDR(¶m->req), SAADDRLEN(¶m->req)) &&
|
if (*SAFAMILY(¶m->sincl) == *SAFAMILY(¶m->req) && !memcmp(SAADDR(¶m->sincl), SAADDR(¶m->req), SAADDRLEN(¶m->req)) &&
|
||||||
*SAPORT(¶m->sincr) == *SAPORT(¶m->req)) return 519;
|
*SAPORT(¶m->sincl) == *SAPORT(¶m->req)) return 519;
|
||||||
|
|
||||||
if (param->operation == ADMIN || param->operation == DNSRESOLVE || param->operation == BIND || param->operation == UDPASSOC)
|
if (param->operation == ADMIN || param->operation == DNSRESOLVE || param->operation == BIND || param->operation == UDPASSOC)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+1
-1
@@ -153,6 +153,7 @@ int start_proxy_thread(struct child * chp){
|
|||||||
pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (16384+conf.stacksize));
|
pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (16384+conf.stacksize));
|
||||||
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
||||||
pthread_create(&thread, &pa, startsrv, (void *)chp);
|
pthread_create(&thread, &pa, startsrv, (void *)chp);
|
||||||
|
pthread_attr_destroy(&pa);
|
||||||
#endif
|
#endif
|
||||||
while(conf.threadinit)usleep(SLEEPTIME);
|
while(conf.threadinit)usleep(SLEEPTIME);
|
||||||
if(haveerror) {
|
if(haveerror) {
|
||||||
@@ -279,7 +280,6 @@ static int h_external(int argc, unsigned char ** argv){
|
|||||||
else conf.extsa6 = sa6;
|
else conf.extsa6 = sa6;
|
||||||
#else
|
#else
|
||||||
res = getip46(46, argv[1], (struct sockaddr *)&conf.extsa);
|
res = getip46(46, argv[1], (struct sockaddr *)&conf.extsa);
|
||||||
if(!res) return 1;
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-3
@@ -88,6 +88,7 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
}
|
}
|
||||||
else if (status >= 3 && (
|
else if (status >= 3 && (
|
||||||
(!strncasecmp((char *)buf, "PASV", 4) && (pasv = 1)) ||
|
(!strncasecmp((char *)buf, "PASV", 4) && (pasv = 1)) ||
|
||||||
|
(!strncasecmp((char *)buf, "EPSV", 4) && (pasv = 2)) ||
|
||||||
(!strncasecmp((char *)buf, "PORT ", 5) && !(pasv = 0))
|
(!strncasecmp((char *)buf, "PORT ", 5) && !(pasv = 0))
|
||||||
)){
|
)){
|
||||||
#ifndef WITHMAIN
|
#ifndef WITHMAIN
|
||||||
@@ -125,8 +126,9 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
if(so._listen(clidatasock, 1)) {RETURN(823);}
|
if(so._listen(clidatasock, 1)) {RETURN(823);}
|
||||||
sasize = sizeof(param->sincl);
|
sasize = sizeof(param->sincl);
|
||||||
if(so._getsockname(clidatasock, (struct sockaddr *)¶m->sincl, &sasize)){RETURN(824);}
|
if(so._getsockname(clidatasock, (struct sockaddr *)¶m->sincl, &sasize)){RETURN(824);}
|
||||||
if(*SAFAMILY(¶m->sincl) == AF_INET)
|
if(pasv == 1){
|
||||||
sprintf((char *)buf, "227 OK (%u,%u,%u,%u,%u,%u)\r\n",
|
if(*SAFAMILY(¶m->sincl) == AF_INET)
|
||||||
|
sprintf((char *)buf, "227 OK (%u,%u,%u,%u,%u,%u)\r\n",
|
||||||
(unsigned)(((unsigned char *)(SAADDR(¶m->sincl)))[0]),
|
(unsigned)(((unsigned char *)(SAADDR(¶m->sincl)))[0]),
|
||||||
(unsigned)(((unsigned char *)(SAADDR(¶m->sincl)))[1]),
|
(unsigned)(((unsigned char *)(SAADDR(¶m->sincl)))[1]),
|
||||||
(unsigned)(((unsigned char *)(SAADDR(¶m->sincl)))[2]),
|
(unsigned)(((unsigned char *)(SAADDR(¶m->sincl)))[2]),
|
||||||
@@ -134,10 +136,16 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[0]),
|
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[0]),
|
||||||
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[1])
|
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[1])
|
||||||
);
|
);
|
||||||
else sprintf((char *)buf, "227 OK (127,0,0,1,%u,%u)\r\n",
|
else sprintf((char *)buf, "227 OK (127,0,0,1,%u,%u)\r\n",
|
||||||
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[0]),
|
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[0]),
|
||||||
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[1])
|
(unsigned)(((unsigned char *)(SAPORT(¶m->sincl)))[1])
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sprintf((char *)buf, "229 OK (|||%u|)\r\n",
|
||||||
|
(unsigned)ntohs(*SAPORT(¶m->sincl))
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unsigned long b1, b2, b3, b4;
|
unsigned long b1, b2, b3, b4;
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ SSL_CERT ssl_copy_cert(SSL_CERT cert)
|
|||||||
unsigned char p2[] = "3proxy";
|
unsigned char p2[] = "3proxy";
|
||||||
unsigned char p3[] = "3proxy CA";
|
unsigned char p3[] = "3proxy CA";
|
||||||
|
|
||||||
static char hash_name[sizeof(src_cert->sha1_hash)*2 + 1];
|
char hash_name[sizeof(src_cert->sha1_hash)*2 + 1];
|
||||||
static char cache_name[200];
|
char cache_name[200];
|
||||||
|
|
||||||
bin2hex(src_cert->sha1_hash, sizeof(src_cert->sha1_hash), hash_name, sizeof(hash_name));
|
bin2hex(src_cert->sha1_hash, sizeof(src_cert->sha1_hash), hash_name, sizeof(hash_name));
|
||||||
sprintf(cache_name, "%s%s.pem", cert_path, hash_name);
|
sprintf(cache_name, "%s%s.pem", cert_path, hash_name);
|
||||||
|
|||||||
+1
-1
@@ -278,7 +278,7 @@ for(;;){
|
|||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
|
|
||||||
if(req) {
|
if(req) {
|
||||||
if(!param->transparent && !param->srv->transparent && param->redirtype != R_HTTP && (i<=prefix || strncasecmp((char *)buf, (char *)req, prefix))){
|
if(!param->transparent && !param->srv->transparent && (i<=prefix || strncasecmp((char *)buf, (char *)req, prefix))){
|
||||||
ckeepalive = 0;
|
ckeepalive = 0;
|
||||||
if(param->remsock != INVALID_SOCKET){
|
if(param->remsock != INVALID_SOCKET){
|
||||||
so._shutdown(param->remsock, SHUT_RDWR);
|
so._shutdown(param->remsock, SHUT_RDWR);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#define UDPBUFSIZE 16384
|
#define UDPBUFSIZE 16384
|
||||||
#define TCPBUFSIZE 8192
|
#define TCPBUFSIZE 8192
|
||||||
|
#define SRVBUFSIZE (param->srv->bufsize?param->srv->bufsize:((param->service == S_UDPPM)?UDPBUFSIZE:TCPBUFSIZE))
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|||||||
+8
-3
@@ -633,7 +633,7 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
*newparam = defparam;
|
*newparam = defparam;
|
||||||
if(defparam.hostname)newparam->hostname=(unsigned char *)strdup((char *)defparam.hostname);
|
if(defparam.hostname)newparam->hostname=(unsigned char *)mystrdup((char *)defparam.hostname);
|
||||||
clearstat(newparam);
|
clearstat(newparam);
|
||||||
if(!isudp) newparam->clisock = new_sock;
|
if(!isudp) newparam->clisock = new_sock;
|
||||||
#ifndef STDMAIN
|
#ifndef STDMAIN
|
||||||
@@ -643,6 +643,7 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
newparam->prev = newparam->next = NULL;
|
newparam->prev = newparam->next = NULL;
|
||||||
|
error = 0;
|
||||||
pthread_mutex_lock(&srv.counter_mutex);
|
pthread_mutex_lock(&srv.counter_mutex);
|
||||||
if(!srv.child){
|
if(!srv.child){
|
||||||
srv.child = newparam;
|
srv.child = newparam;
|
||||||
@@ -665,7 +666,7 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
else {
|
else {
|
||||||
sprintf((char *)buf, "_beginthreadex(): %s", _strerror(NULL));
|
sprintf((char *)buf, "_beginthreadex(): %s", _strerror(NULL));
|
||||||
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
||||||
freeparam(newparam);
|
error = 1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -674,13 +675,14 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
if(error){
|
if(error){
|
||||||
sprintf((char *)buf, "pthread_create(): %s", strerror(error));
|
sprintf((char *)buf, "pthread_create(): %s", strerror(error));
|
||||||
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
||||||
freeparam(newparam);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
newparam->threadid = (unsigned)thread;
|
newparam->threadid = (unsigned)thread;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
pthread_mutex_unlock(&srv.counter_mutex);
|
pthread_mutex_unlock(&srv.counter_mutex);
|
||||||
|
if(error) freeparam(newparam);
|
||||||
|
|
||||||
memset(&defparam.sincl, 0, sizeof(defparam.sincl));
|
memset(&defparam.sincl, 0, sizeof(defparam.sincl));
|
||||||
memset(&defparam.sincr, 0, sizeof(defparam.sincr));
|
memset(&defparam.sincr, 0, sizeof(defparam.sincr));
|
||||||
if(isudp) while(!srv.fds.events)usleep(SLEEPTIME);
|
if(isudp) while(!srv.fds.events)usleep(SLEEPTIME);
|
||||||
@@ -699,6 +701,9 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
pthread_mutex_unlock(&config_mutex);
|
pthread_mutex_unlock(&config_mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
pthread_attr_destroy(&pa);
|
||||||
|
#endif
|
||||||
if(defparam.hostname)myfree(defparam.hostname);
|
if(defparam.hostname)myfree(defparam.hostname);
|
||||||
if(cbc_string)myfree(cbc_string);
|
if(cbc_string)myfree(cbc_string);
|
||||||
if(cbl_string)myfree(cbl_string);
|
if(cbl_string)myfree(cbl_string);
|
||||||
|
|||||||
+3
-6
@@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
#include "proxy.h"
|
#include "proxy.h"
|
||||||
|
|
||||||
#define BUFSIZE (param->srv->bufsize?param->srv->bufsize:((param->service == S_UDPPM)?UDPBUFSIZE:TCPBUFSIZE))
|
|
||||||
|
|
||||||
|
|
||||||
int socksend(SOCKET sock, unsigned char * buf, int bufsize, int to){
|
int socksend(SOCKET sock, unsigned char * buf, int bufsize, int to){
|
||||||
int sent = 0;
|
int sent = 0;
|
||||||
int res;
|
int res;
|
||||||
@@ -75,8 +72,8 @@ int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec){
|
|||||||
int len;
|
int len;
|
||||||
|
|
||||||
if(!param->clibuf){
|
if(!param->clibuf){
|
||||||
if(!(param->clibuf = myalloc(BUFSIZE))) return 0;
|
if(!(param->clibuf = myalloc(SRVBUFSIZE))) return 0;
|
||||||
param->clibufsize = BUFSIZE;
|
param->clibufsize = SRVBUFSIZE;
|
||||||
param->clioffset = param->cliinbuf = 0;
|
param->clioffset = param->cliinbuf = 0;
|
||||||
}
|
}
|
||||||
if(param->cliinbuf && param->clioffset < param->cliinbuf){
|
if(param->cliinbuf && param->clioffset < param->cliinbuf){
|
||||||
@@ -137,7 +134,7 @@ int sockgetcharsrv(struct clientparam * param, int timeosec, int timeousec){
|
|||||||
int bufsize;
|
int bufsize;
|
||||||
|
|
||||||
if(!param->srvbuf){
|
if(!param->srvbuf){
|
||||||
bufsize = BUFSIZE;
|
bufsize = SRVBUFSIZE;
|
||||||
if(param->ndatfilterssrv > 0 && bufsize < 32768) bufsize = 32768;
|
if(param->ndatfilterssrv > 0 && bufsize < 32768) bufsize = 32768;
|
||||||
if(!(param->srvbuf = myalloc(bufsize))) return 0;
|
if(!(param->srvbuf = myalloc(bufsize))) return 0;
|
||||||
param->srvbufsize = bufsize;
|
param->srvbufsize = bufsize;
|
||||||
|
|||||||
+4
-3
@@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
#include "proxy.h"
|
#include "proxy.h"
|
||||||
|
|
||||||
#define BUFSIZE (param->srv->bufsize?param->srv->bufsize:((param->service == S_UDPPM)?UDPBUFSIZE:TCPBUFSIZE))
|
|
||||||
|
|
||||||
int sockmap(struct clientparam * param, int timeo){
|
int sockmap(struct clientparam * param, int timeo){
|
||||||
int res=0;
|
int res=0;
|
||||||
uint64_t sent=0, received=0;
|
uint64_t sent=0, received=0;
|
||||||
@@ -21,13 +19,16 @@ int sockmap(struct clientparam * param, int timeo){
|
|||||||
FILTER_ACTION action;
|
FILTER_ACTION action;
|
||||||
int retcode = 0;
|
int retcode = 0;
|
||||||
|
|
||||||
bufsize = BUFSIZE;
|
bufsize = SRVBUFSIZE;
|
||||||
|
|
||||||
minsize = (param->service == S_UDPPM || param->service == S_TCPPM)? bufsize - 1 : (bufsize>>2);
|
minsize = (param->service == S_UDPPM || param->service == S_TCPPM)? bufsize - 1 : (bufsize>>2);
|
||||||
|
|
||||||
fds[0].fd = param->clisock;
|
fds[0].fd = param->clisock;
|
||||||
fds[1].fd = param->remsock;
|
fds[1].fd = param->remsock;
|
||||||
|
|
||||||
|
|
||||||
|
if(param->cliinbuf == param->clioffset) param->cliinbuf = param->clioffset = 0;
|
||||||
|
if(param->srvinbuf == param->srvoffset) param->srvinbuf = param->srvoffset = 0;
|
||||||
#if DEBUGLEVEL > 2
|
#if DEBUGLEVEL > 2
|
||||||
(*param->srv->logfunc)(param, "Starting sockets mapping");
|
(*param->srv->logfunc)(param, "Starting sockets mapping");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-1
@@ -444,7 +444,8 @@ struct clientparam {
|
|||||||
int redirected,
|
int redirected,
|
||||||
operation,
|
operation,
|
||||||
nfilters, nreqfilters, nhdrfilterscli, nhdrfilterssrv, npredatfilters, ndatfilterscli, ndatfilterssrv,
|
nfilters, nreqfilters, nhdrfilterscli, nhdrfilterssrv, npredatfilters, ndatfilterscli, ndatfilterssrv,
|
||||||
unsafefilter;
|
unsafefilter,
|
||||||
|
bandlimver;
|
||||||
|
|
||||||
int res,
|
int res,
|
||||||
status;
|
status;
|
||||||
|
|||||||
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
#define VERSION "3proxy-0.8.8"
|
#define VERSION "3proxy-0.8.10"
|
||||||
#define BUILDDATE "161213011647"
|
#define BUILDDATE "170625190910"
|
||||||
Reference in new issue
Block a user