mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-24 11:05:40 +08:00

- 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
41 lines
753 B
C
41 lines
753 B
C
/*
|
|
3APA3A simpliest proxy server
|
|
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
|
|
|
|
please read License Agreement
|
|
|
|
*/
|
|
|
|
#include "proxy.h"
|
|
|
|
#ifndef PORTMAP
|
|
#define PORTMAP
|
|
#endif
|
|
#define RETURN(xxx) { param->res = xxx; goto CLEANRET; }
|
|
|
|
void * tcppmchild(struct clientparam* param) {
|
|
int res;
|
|
|
|
if(!param->hostname)parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport));
|
|
param->operation = CONNECT;
|
|
res = (*param->srv->authfunc)(param);
|
|
if(res) {RETURN(res);}
|
|
RETURN (mapsocket(param, conf.timeouts[CONNECTION_L]));
|
|
CLEANRET:
|
|
|
|
dolog(param, param->hostname);
|
|
freeparam(param);
|
|
return (NULL);
|
|
}
|
|
|
|
#ifdef WITHMAIN
|
|
struct proxydef childdef = {
|
|
tcppmchild,
|
|
0,
|
|
0,
|
|
S_TCPPM,
|
|
""
|
|
};
|
|
#include "proxymain.c"
|
|
#endif
|