mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
285a7e6765 | ||
|
|
b2f82ed04f | ||
|
|
01ec2f12d5 | ||
|
|
624c3e6ae1 | ||
|
|
0d713dacc1 | ||
|
|
582f9d7be4 | ||
|
|
3f2659cb0f | ||
|
|
aeb0f4caa5 | ||
|
|
22555b58ec | ||
|
|
5448329c8a | ||
|
|
a8b000b7f1 | ||
|
|
edaee895e6 |
No files matched your search
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
1 VERSIONINFO
|
1 VERSIONINFO
|
||||||
FILEVERSION 0,9,0,0
|
FILEVERSION 0,9,0,201022
|
||||||
PRODUCTVERSION 0,9,0,0
|
PRODUCTVERSION 0,9,0,201022
|
||||||
FILETYPE 1
|
FILETYPE 1
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
BEGIN
|
BEGIN
|
||||||
@@ -14,12 +14,12 @@ BEGIN
|
|||||||
VALUE "Comments", "3proxy - tiny proxy server, http://3proxy.org/\0"
|
VALUE "Comments", "3proxy - tiny proxy server, http://3proxy.org/\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.9-devel-" BUILDDATE "\0"
|
VALUE "FileVersion", "0.9.0\0"
|
||||||
VALUE "InternalName", "3proxy\0"
|
VALUE "InternalName", "3proxy\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2002-2019 Vladimir Dubrovin\0"
|
VALUE "LegalCopyright", "Copyright (C) 2002-2020 Vladimir Dubrovin\0"
|
||||||
VALUE "OriginalFilename", "3proxy.exe\0"
|
VALUE "OriginalFilename", "3proxy.exe\0"
|
||||||
VALUE "ProductName", "3proxy\0"
|
VALUE "ProductName", "3proxy\0"
|
||||||
VALUE "ProductVersion", "0.9-devel-" BUILDDATE "\0"
|
VALUE "ProductVersion", "0.9.0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 3APA3A 3proxy tiny proxy server
|
# 3APA3A 3proxy tiny proxy server
|
||||||
(c) 2002-2019 by Vladimir '3APA3A' Dubrovin <3proxy@3proxy.ru>
|
(c) 2002-2020 by Vladimir '3APA3A' Dubrovin <3proxy@3proxy.ru>
|
||||||
|
|
||||||
Download:
|
Download:
|
||||||
https://github.com/z3APA3A/3proxy/releases
|
https://github.com/z3APA3A/3proxy/releases
|
||||||
@@ -58,7 +58,7 @@ Please read doc/html/index.html and man pages.
|
|||||||
+ Threaded application (no child process).
|
+ Threaded application (no child process).
|
||||||
+ Web administration and statistics
|
+ Web administration and statistics
|
||||||
+ Plugins for functionality extension
|
+ Plugins for functionality extension
|
||||||
+ Native 64 bit application
|
+ Native 32/64 bit application
|
||||||
2. Proxy chaining and network connections
|
2. Proxy chaining and network connections
|
||||||
+ Can be used as a bridge between client and different proxy type
|
+ Can be used as a bridge between client and different proxy type
|
||||||
(e.g. convert incoming HTTP proxy request from client to SOCKSv5
|
(e.g. convert incoming HTTP proxy request from client to SOCKSv5
|
||||||
@@ -78,9 +78,8 @@ Please read doc/html/index.html and man pages.
|
|||||||
+ syslog logging (Unix)
|
+ syslog logging (Unix)
|
||||||
+ ODBC logging
|
+ ODBC logging
|
||||||
+ RADIUS accounting
|
+ RADIUS accounting
|
||||||
+ log file rotation (hourly, daily, weekly, monthly)
|
+ log file rotation
|
||||||
+ automatic log file comperssion with external archiver (for files)
|
+ automatic log file processing with external archiver (for files)
|
||||||
+ automatic removal of older log files
|
|
||||||
+ Character filtering for log files
|
+ Character filtering for log files
|
||||||
+ different log files for different servces are supported
|
+ different log files for different servces are supported
|
||||||
4. Access control
|
4. Access control
|
||||||
@@ -89,12 +88,13 @@ Please read doc/html/index.html and man pages.
|
|||||||
(POST, PUT, GET, etc), weekday and daytime.
|
(POST, PUT, GET, etc), weekday and daytime.
|
||||||
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
||||||
combined) bandwith limitation for incoming and (!)outgoing trafic.
|
combined) bandwith limitation for incoming and (!)outgoing trafic.
|
||||||
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
+ ACL-driven traffic limitation per day, week or month for incoming and
|
||||||
combined) traffic limitation per day, week or month for incoming and
|
|
||||||
outgoing traffic
|
outgoing traffic
|
||||||
|
+ Connection limitation and ratelimting
|
||||||
+ User authentication by username / password
|
+ User authentication by username / password
|
||||||
+ RADIUS Authentication and Authorization
|
+ RADIUS Authentication and Authorization
|
||||||
+ User authentication by DNS hostname
|
+ User authentication by DNS hostname
|
||||||
|
+ Authentication cache with possibility to limit user to single IP address
|
||||||
+ Access control by username/password for SOCKSv5 and HTTP/HTTPS/FTP
|
+ Access control by username/password for SOCKSv5 and HTTP/HTTPS/FTP
|
||||||
+ Cleartext or encrypted (crypt/MD5 or NT) passwords.
|
+ Cleartext or encrypted (crypt/MD5 or NT) passwords.
|
||||||
+ Connection redirection
|
+ Connection redirection
|
||||||
|
|||||||
@@ -874,7 +874,7 @@ You can control 3proxy service via "Services" administration ot via "net" comman
|
|||||||
<li>90 - unexpected system error (should not happen)
|
<li>90 - unexpected system error (should not happen)
|
||||||
<li>91 - unexpected poll error (should not happen)
|
<li>91 - unexpected poll error (should not happen)
|
||||||
<li>92 - connection terminated by timeout (see timeouts)
|
<li>92 - connection terminated by timeout (see timeouts)
|
||||||
<li>93 - connection terminated by ratelimit-related timeout
|
<li>93 - connection terminated by ratelimit-related timeout or due to errors limit
|
||||||
<li>94 - connection termination by server or client with unsent data
|
<li>94 - connection termination by server or client with unsent data
|
||||||
<li>95 - dirty connection termination by client (or networking issue)
|
<li>95 - dirty connection termination by client (or networking issue)
|
||||||
<li>96 - dirty connection termination by server (or networking issue)
|
<li>96 - dirty connection termination by server (or networking issue)
|
||||||
|
|||||||
@@ -1050,7 +1050,7 @@
|
|||||||
<li>90 - неожиданная системная ошибка (не должно происходить)
|
<li>90 - неожиданная системная ошибка (не должно происходить)
|
||||||
<li>91 - ошибка poll (не должно происходить)
|
<li>91 - ошибка poll (не должно происходить)
|
||||||
<li>92 - соединение прервано по таймауту на сетевую операцию (см. timeouts)
|
<li>92 - соединение прервано по таймауту на сетевую операцию (см. timeouts)
|
||||||
<li>93 - соединение прервано по таймауту связанному с рейтлимитом
|
<li>93 - соединение прервано по таймауту связанному с рейтлимитом или из-за превышения числа ошибок
|
||||||
<li>94 - клиент или сервер закрыли соединение или произошла сетевая ошибка, остались неотправленные данные
|
<li>94 - клиент или сервер закрыли соединение или произошла сетевая ошибка, остались неотправленные данные
|
||||||
<li>95 - клиент "грязно" закрыл соединение или сетевая ошибка
|
<li>95 - клиент "грязно" закрыл соединение или сетевая ошибка
|
||||||
<li>96 - сервер "грязно" закрыл соединение или сетевая ошибка
|
<li>96 - сервер "грязно" закрыл соединение или сетевая ошибка
|
||||||
|
|||||||
@@ -240,6 +240,8 @@ alternate config file. Think twice before using it.
|
|||||||
@ (for Unix) use syslog, filename is used as ident name
|
@ (for Unix) use syslog, filename is used as ident name
|
||||||
.br
|
.br
|
||||||
& use ODBC, filename consists of comma-delimited datasource,username,password (username and password are optional)
|
& use ODBC, filename consists of comma-delimited datasource,username,password (username and password are optional)
|
||||||
|
.br
|
||||||
|
radius - use RADIUS for logging
|
||||||
.br
|
.br
|
||||||
LOGTYPE is one of:
|
LOGTYPE is one of:
|
||||||
.br
|
.br
|
||||||
@@ -388,6 +390,28 @@ can use %A as produced archive name and %F as filename.
|
|||||||
.br
|
.br
|
||||||
default timeouts 1 5 30 60 180 1800 15 60 15 5
|
default timeouts 1 5 30 60 180 1800 15 60 15 5
|
||||||
|
|
||||||
|
.br
|
||||||
|
.B radius
|
||||||
|
<NAS_SECRET> <radius_server_1[:port][/local_address_1]> <radius_server_2[:port][/local_address_2]>
|
||||||
|
.br
|
||||||
|
Configures RADIUS servers to be used for logging and authentication (log and auth types
|
||||||
|
must be set to radius). port and local address to use with given server may be specified.
|
||||||
|
.br
|
||||||
|
Attributes within request: User-Name, Password: (username and password if presented by client),
|
||||||
|
Service Type: Authenticate-Only,
|
||||||
|
NAS-Port-Type: NAS-Port-Virtual,
|
||||||
|
NAS-Port-ID: (proxy service port, e.g. 1080),
|
||||||
|
NAS-IPv6-Address / NAS-IP-Address: (proxy interface accessed by client),
|
||||||
|
NAS-Identifier: (text identifing proxy, e.g. PROXY or SOCKSv5),
|
||||||
|
Framed-IPv6-Address / Framed-IP-Address: (IP address of the client),
|
||||||
|
Called-Station-ID: (requested Hostname, if presents),
|
||||||
|
Login-Service: (type of request, e.g. 1001 - SOCKS CONNECT, 1010 - HTTP GET, 1013 - HTTP CONNECT),
|
||||||
|
Login-TCP-Port: (requested port),
|
||||||
|
Login-IPv6-Host / Login-IP-Host: (requested IP).
|
||||||
|
.br
|
||||||
|
Supported reply attributes for authentication:
|
||||||
|
Framed-IP-Address / Framed-IPv6-Address (IP to assign to user), Reply-Message.
|
||||||
|
Use authcache to speedup authentication. RADIUS feature is currently experimental.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
.B nserver
|
.B nserver
|
||||||
@@ -503,6 +527,8 @@ NB: there is no any password check, name may be spoofed.
|
|||||||
SOCKSv5, FTP, POP3 and HTTP proxy.
|
SOCKSv5, FTP, POP3 and HTTP proxy.
|
||||||
.br
|
.br
|
||||||
cache - cached authentication, may be used with \'authcache\'.
|
cache - cached authentication, may be used with \'authcache\'.
|
||||||
|
.br
|
||||||
|
radius - authentication with RADIUS.
|
||||||
.br
|
.br
|
||||||
Plugins may add additional authentication types.
|
Plugins may add additional authentication types.
|
||||||
|
|
||||||
|
|||||||
@@ -554,6 +554,7 @@ int radsend(struct clientparam * param, int auth, int stop){
|
|||||||
}
|
}
|
||||||
else remsock = radiuslist[loop].logsock;
|
else remsock = radiuslist[loop].logsock;
|
||||||
*/
|
*/
|
||||||
|
so._bind(param->remsock,(struct sockaddr *)&radiuslist[loop].localaddr,SASIZE(&radiuslist[loop].localaddr));
|
||||||
len = so._sendto(remsock, (char *)&packet, total_length, 0,
|
len = so._sendto(remsock, (char *)&packet, total_length, 0,
|
||||||
(struct sockaddr *)&saremote, sizeof(saremote));
|
(struct sockaddr *)&saremote, sizeof(saremote));
|
||||||
if(len != ntohs(packet.length)){
|
if(len != ntohs(packet.length)){
|
||||||
|
|||||||
+4
-1
@@ -293,7 +293,10 @@ int parsehostname(char *hostname, struct clientparam *param, unsigned short port
|
|||||||
|
|
||||||
if(!hostname || !*hostname)return 2;
|
if(!hostname || !*hostname)return 2;
|
||||||
if(*hostname == '[') se=strchr(hostname, ']');
|
if(*hostname == '[') se=strchr(hostname, ']');
|
||||||
if ( (sp = strchr(se?se:hostname, ':')) && !strchr(sp+1, ':')) *sp = 0;
|
if (sp = strchr(se?se:hostname, ':')) {
|
||||||
|
if(strchr(sp+1, ':'))sp = NULL;
|
||||||
|
else *sp = 0;
|
||||||
|
}
|
||||||
if(se){
|
if(se){
|
||||||
*se = 0;
|
*se = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-1
@@ -1329,13 +1329,19 @@ static int h_radius(int argc, unsigned char **argv){
|
|||||||
if(strlen(argv[1]) > 63) argv[1][63] = 0;
|
if(strlen(argv[1]) > 63) argv[1][63] = 0;
|
||||||
strcpy(radiussecret, argv[1]);
|
strcpy(radiussecret, argv[1]);
|
||||||
for( nradservers=0; nradservers < MAXRADIUS && nradservers < argc -2; nradservers++){
|
for( nradservers=0; nradservers < MAXRADIUS && nradservers < argc -2; nradservers++){
|
||||||
|
char *s = 0;
|
||||||
|
if(strchr(argv[nradservers + 2], '/')){
|
||||||
|
*s = 0;
|
||||||
|
s++;
|
||||||
|
}
|
||||||
if( !getip46(46, argv[nradservers + 2], (struct sockaddr *)&radiuslist[nradservers].authaddr)) return 1;
|
if( !getip46(46, argv[nradservers + 2], (struct sockaddr *)&radiuslist[nradservers].authaddr)) return 1;
|
||||||
|
if( s && !getip46(46, s, (struct sockaddr *)&radiuslist[nradservers].localaddr)) return 2;
|
||||||
if(!*SAPORT(&radiuslist[nradservers].authaddr))*SAPORT(&radiuslist[nradservers].authaddr) = htons(1812);
|
if(!*SAPORT(&radiuslist[nradservers].authaddr))*SAPORT(&radiuslist[nradservers].authaddr) = htons(1812);
|
||||||
port = ntohs(*SAPORT(&radiuslist[nradservers].authaddr));
|
port = ntohs(*SAPORT(&radiuslist[nradservers].authaddr));
|
||||||
radiuslist[nradservers].logaddr = radiuslist[nradservers].authaddr;
|
radiuslist[nradservers].logaddr = radiuslist[nradservers].authaddr;
|
||||||
*SAPORT(&radiuslist[nradservers].logaddr) = htons(port+1);
|
*SAPORT(&radiuslist[nradservers].logaddr) = htons(port+1);
|
||||||
/*
|
/*
|
||||||
bindaddr = conf.intsa;
|
bindaddr = radiuslist[nradservers].localaddr;
|
||||||
if ((radiuslist[nradservers].logsock = so._socket(SASOCK(&radiuslist[nradservers].logaddr), SOCK_DGRAM, 0)) < 0) return 2;
|
if ((radiuslist[nradservers].logsock = so._socket(SASOCK(&radiuslist[nradservers].logaddr), SOCK_DGRAM, 0)) < 0) return 2;
|
||||||
if (so._bind(radiuslist[nradservers].logsock, (struct sockaddr *)&bindaddr, SASIZE(&bindaddr))) return 3;
|
if (so._bind(radiuslist[nradservers].logsock, (struct sockaddr *)&bindaddr, SASIZE(&bindaddr))) return 3;
|
||||||
*/
|
*/
|
||||||
|
|||||||
+2
-2
@@ -320,9 +320,9 @@ extern struct commands commandhandlers[];
|
|||||||
|
|
||||||
extern struct radserver {
|
extern struct radserver {
|
||||||
#ifdef NOIPV6
|
#ifdef NOIPV6
|
||||||
struct sockaddr_in authaddr, logaddr;
|
struct sockaddr_in authaddr, logaddr, localaddr;
|
||||||
#else
|
#else
|
||||||
struct sockaddr_in6 authaddr, logaddr;
|
struct sockaddr_in6 authaddr, logaddr, localaddr;
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
SOCKET logsock;
|
SOCKET logsock;
|
||||||
|
|||||||
+5
-6
@@ -61,7 +61,7 @@ void * threadfunc (void *p) {
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
sigfillset(&mask);
|
sigfillset(&mask);
|
||||||
pthread_sigmask(SIG_SETMASK, &mask, NULL);
|
if(param->srv->service != S_UDPPM)pthread_sigmask(SIG_SETMASK, &mask, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
((struct clientparam *) p)->srv->pf((struct clientparam *)p);
|
((struct clientparam *) p)->srv->pf((struct clientparam *)p);
|
||||||
@@ -286,11 +286,6 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
srv.next = conf.services;
|
srv.next = conf.services;
|
||||||
conf.services = conf.services->prev = &srv;
|
conf.services = conf.services->prev = &srv;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
srv.needuser = 0;
|
|
||||||
pthread_mutex_init(&log_mutex, NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
{
|
{
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
@@ -298,6 +293,10 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
pthread_sigmask(SIG_SETMASK, &mask, NULL);
|
pthread_sigmask(SIG_SETMASK, &mask, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
srv.needuser = 0;
|
||||||
|
pthread_mutex_init(&log_mutex, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i=1; i<argc; i++) {
|
for (i=1; i<argc; i++) {
|
||||||
if(*argv[i]=='-') {
|
if(*argv[i]=='-') {
|
||||||
|
|||||||
+23
-7
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include "proxy.h"
|
#include "proxy.h"
|
||||||
|
|
||||||
|
#define MAXFAILATTEMPT 10
|
||||||
|
|
||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
#if WITHLOG > 1
|
#if WITHLOG > 1
|
||||||
char logbuf[1024];
|
char logbuf[1024];
|
||||||
@@ -121,17 +123,17 @@ int sockmap(struct clientparam * param, int timeo, int usesplice){
|
|||||||
if(action != PASS) RETURN(19);
|
if(action != PASS) RETURN(19);
|
||||||
|
|
||||||
while(
|
while(
|
||||||
((!CLIENTTERM) && (inserverbuf
|
((!CLIENTTERM) && fromserver && (inserverbuf
|
||||||
#ifdef WITHSPLICE
|
#ifdef WITHSPLICE
|
||||||
|| inserverpipe
|
|| inserverpipe
|
||||||
#endif
|
#endif
|
||||||
|| (!SERVERTERM && fromserver)))
|
|| (!SERVERTERM )))
|
||||||
||
|
||
|
||||||
((!SERVERTERM) && (inclientbuf
|
((!SERVERTERM) && fromclient && (inclientbuf
|
||||||
#ifdef WITHSPLICE
|
#ifdef WITHSPLICE
|
||||||
|| inclientpipe
|
|| inclientpipe
|
||||||
#endif
|
#endif
|
||||||
|| (!CLIENTTERM && fromclient)))
|
|| (!CLIENTTERM )))
|
||||||
){
|
){
|
||||||
|
|
||||||
|
|
||||||
@@ -157,7 +159,7 @@ log(logbuf);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(needaction > 2 && !sleeptime){
|
if(needaction > 2 && !sleeptime){
|
||||||
if(needaction > 13){RETURN (93);}
|
if(needaction > (MAXFAILATTEMPT+1)){RETURN (93);}
|
||||||
sleeptime = (1<<(needaction-2));
|
sleeptime = (1<<(needaction-2));
|
||||||
}
|
}
|
||||||
if(sleeptime > 0) {
|
if(sleeptime > 0) {
|
||||||
@@ -315,6 +317,10 @@ log("read from client to pipe");
|
|||||||
log("read failed");
|
log("read failed");
|
||||||
#endif
|
#endif
|
||||||
FROMCLIENT = TOCLIENTPIPE = 0;
|
FROMCLIENT = TOCLIENTPIPE = 0;
|
||||||
|
if(res == 0) {
|
||||||
|
CLIENTTERM = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
@@ -338,6 +344,10 @@ log("splice finished\n");
|
|||||||
#endif
|
#endif
|
||||||
if(res <= 0) {
|
if(res <= 0) {
|
||||||
FROMSERVER = TOSERVERPIPE = 0;
|
FROMSERVER = TOSERVERPIPE = 0;
|
||||||
|
if(res == 0 || !errno) {
|
||||||
|
SERVERTERM = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
@@ -371,8 +381,11 @@ log("read from client to buf");
|
|||||||
sasize = sizeof(param->sincr);
|
sasize = sizeof(param->sincr);
|
||||||
res = so._recvfrom(param->clisock, (char *)param->clibuf + param->cliinbuf, (int)MIN((uint64_t)param->clibufsize - param->cliinbuf, fromclient-inclientbuf), 0, (struct sockaddr *)¶m->sincr, &sasize);
|
res = so._recvfrom(param->clisock, (char *)param->clibuf + param->cliinbuf, (int)MIN((uint64_t)param->clibufsize - param->cliinbuf, fromclient-inclientbuf), 0, (struct sockaddr *)¶m->sincr, &sasize);
|
||||||
if(res <= 0) {
|
if(res <= 0) {
|
||||||
if(!errno)CLIENTTERM = 1;
|
|
||||||
FROMCLIENT = 0;
|
FROMCLIENT = 0;
|
||||||
|
if(res == 0){
|
||||||
|
CLIENTTERM = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
@@ -393,8 +406,11 @@ log("read from server to buf");
|
|||||||
sasize = sizeof(param->sinsr);
|
sasize = sizeof(param->sinsr);
|
||||||
res = so._recvfrom(param->remsock, (char *)param->srvbuf + param->srvinbuf, (int)MIN((uint64_t)param->srvbufsize - param->srvinbuf, fromserver-inserverbuf), 0, (struct sockaddr *)¶m->sinsr, &sasize);
|
res = so._recvfrom(param->remsock, (char *)param->srvbuf + param->srvinbuf, (int)MIN((uint64_t)param->srvbufsize - param->srvinbuf, fromserver-inserverbuf), 0, (struct sockaddr *)¶m->sinsr, &sasize);
|
||||||
if(res <= 0) {
|
if(res <= 0) {
|
||||||
if(!errno) SERVERTERM = 1;
|
|
||||||
FROMSERVER = 0;
|
FROMSERVER = 0;
|
||||||
|
if(res == 0) {
|
||||||
|
SERVERTERM = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
void * tcppmchild(struct clientparam* param) {
|
void * tcppmchild(struct clientparam* param) {
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if(!param->hostname)parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport));
|
if(!param->hostname && parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport))) RETURN(100);
|
||||||
param->operation = CONNECT;
|
param->operation = CONNECT;
|
||||||
res = (*param->srv->authfunc)(param);
|
res = (*param->srv->authfunc)(param);
|
||||||
if(res) {RETURN(res);}
|
if(res) {RETURN(res);}
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ void * udppmchild(struct clientparam* param) {
|
|||||||
struct pollfd fds[256];
|
struct pollfd fds[256];
|
||||||
|
|
||||||
|
|
||||||
if(!param->hostname)parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport));
|
if(!param->hostname && parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport))) RETURN(100);
|
||||||
if (SAISNULL(¶m->req)) {
|
if (SAISNULL(¶m->req)) {
|
||||||
param->srv->fds.events = POLLIN;
|
param->srv->fds.events = POLLIN;
|
||||||
RETURN (100);
|
RETURN (100);
|
||||||
|
|||||||
Reference in new issue
Block a user