mirror of
https://github.com/3proxy/3proxy.git
synced 2025-05-17 18:02:48 +08:00

Some checks failed
C/C++ CI / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
37 lines
770 B
C
37 lines
770 B
C
/*
|
|
3APA3A simpliest proxy server
|
|
(c) 2002-2021 by Vladimir Dubrovin <3proxy@3proxy.org>
|
|
|
|
please read License Agreement
|
|
|
|
*/
|
|
|
|
#include "proxy.h"
|
|
|
|
|
|
void * autochild(struct clientparam* param) {
|
|
int len;
|
|
|
|
if(!param->clibuf){
|
|
if(!(param->clibuf = myalloc(SRVBUFSIZE))) return 0;
|
|
param->clibufsize = SRVBUFSIZE;
|
|
param->clioffset = param->cliinbuf = 0;
|
|
}
|
|
len = sockfillbuffcli(param, 1, CONNECTION_S);
|
|
if (len != 1){
|
|
param->res = 801;
|
|
dolog(param, (unsigned char *)"");
|
|
}
|
|
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);
|
|
}
|
|
|