Major code refactoring

- sockmapping rewritten from stratch to minimilse polling. poll() is now
only called if blocking is actually expected, splice pipes are now
polled if splice fails, buffers flushing is much more accurate.
- logging code moved to separate files
- signal masks added to client threads to prevent unneeded interruptions
- bandwidth limitation will not delay the thread after client or server
shutdown
This commit is contained in:
z3APA3A committed 2020-10-09 15:42:34 +03:00
1 parent 3dd1969657
commit eb829b062b
17 files changed
+724 -586

No files matched your search

+22 -2
View File
@@ -1,18 +1,38 @@
/*
3APA3A simpliest proxy server
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
(c) 2002-2020 by Vladimir Dubrovin <3proxy@3proxy.ru>
please read License Agreement
*/
pthread_mutex_t log_mutex;
#include "proxy.h"
pthread_mutex_t log_mutex;
int havelog = 0;
struct clientparam logparam;
struct srvparam logsrv;
void dolog(struct clientparam * param, const unsigned char *s){
static int init = 0;
if(param)param->srv->logfunc(param, s);
else {
if(!init){
srvinit(&logsrv, &logparam);
init = 1;
}
logstdout(&logparam, s);
}
}
void clearstat(struct clientparam * param) {
#ifdef _WIN32