Fix socks v5 parent with no auth
Some checks failed
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled

This commit is contained in:
Vladimir Dubrovin 2026-05-15 18:45:47 +03:00
parent 381ef993a7
commit 7c1bc48c85

View File

@ -134,12 +134,13 @@ int clientnegotiate(struct chain * redir, struct clientparam * param, struct soc
int atyp; int atyp;
int skip_port = 0; int skip_port = 0;
buf[0] = 5; buf[0] = 5;
buf[1] = user? 1 : 0; buf[1] = user? 2 : 1;
buf[2] = 2; buf[2] = 0;
if(socksend(param, param->remsock, buf, user?3:2, conf.timeouts[CHAIN_TO]) < 2){ buf[3] = 2;
if(socksend(param, param->remsock, buf, user?4:3, conf.timeouts[CHAIN_TO]) < 2){
return 51; return 51;
} }
param->statssrv64+=3; param->statssrv64+=user?4:3;
param->nwrites++; param->nwrites++;
if(sockgetlinebuf(param, SERVER, buf, 2, EOF, conf.timeouts[CHAIN_TO]) != 2){ if(sockgetlinebuf(param, SERVER, buf, 2, EOF, conf.timeouts[CHAIN_TO]) != 2){
return 52; return 52;