mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a14a3bcdb | ||
|
|
17665e1f8e | ||
|
|
bf04b9465b | ||
|
|
4e92e71349 | ||
|
|
f25c501cb4 | ||
|
|
1ce4a496f6 | ||
|
|
b41d6590cb | ||
|
|
eb8522bb8f | ||
|
|
1a27fd88a9 | ||
|
|
443a4c02d0 | ||
|
|
40d03b8a4a | ||
|
|
53098814f0 | ||
|
|
8f4243ffe1 | ||
|
|
618673c335 | ||
|
|
f452009079 | ||
|
|
2b0f8bbcfc |
No files matched your search
+2
-2
@@ -14,17 +14,17 @@ tmp/
|
||||
*.bat
|
||||
*.swp
|
||||
*.o
|
||||
3proxy.res
|
||||
*.idb
|
||||
src/version.h
|
||||
src/res
|
||||
version.c
|
||||
3proxy.res
|
||||
doc/html/man3/
|
||||
doc/html/man8/
|
||||
doc/html/index.html
|
||||
*.var
|
||||
verfile.sh
|
||||
Makefile
|
||||
Changelog
|
||||
copytgz.sh
|
||||
*~.nib
|
||||
local.properties
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -1,7 +1,6 @@
|
||||
#include "src/version.h"
|
||||
#include "afxres.h"
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
LANGUAGE 0x09, 0x01
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,7,0,0
|
||||
@@ -18,9 +17,9 @@ BEGIN
|
||||
VALUE "FileDescription", "3proxy - tiny proxy server"
|
||||
VALUE "FileVersion", VERSION "-" BUILDDATE
|
||||
VALUE "InternalName", "3proxy"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2002-2009 Vladimir Dubrovin"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2002-2014 Vladimir Dubrovin"
|
||||
VALUE "OriginalFilename", "3proxy.exe"
|
||||
VALUE "ProductName", "3proxy"
|
||||
VALUE "ProductName", "3proxy - tiny proxy server"
|
||||
VALUE "ProductVersion", VERSION
|
||||
END
|
||||
END
|
||||
@@ -29,4 +28,4 @@ BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
||||
|
||||
0 ICON DISCARDABLE "3proxy.ico"
|
||||
+6
-2
@@ -19,7 +19,9 @@ LDFLAGS = -Wall -O2 -pthread
|
||||
DLFLAGS = -shared
|
||||
DLSUFFICS = .ld.so
|
||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||
LIBS = -lcrypto -lssl -ldl
|
||||
#LIBS = -lcrypto -lssl -ldl
|
||||
# libcrypto and libssl are required for SSLPlugin
|
||||
LIBS = -ldl
|
||||
LNOUT = -o
|
||||
EXESUFFICS =
|
||||
OBJSUFFICS = .o
|
||||
@@ -29,7 +31,9 @@ REMOVECOMMAND = rm -f
|
||||
TYPECOMMAND = cat
|
||||
COMPATLIBS =
|
||||
MAKEFILE = Makefile.Linux
|
||||
PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
# SSLPlugin is not built by default because of external dependencies
|
||||
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
|
||||
include Makefile.inc
|
||||
|
||||
|
||||
+9
-2
@@ -15,7 +15,8 @@ LN = link
|
||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
||||
DLFLAGS = /DLL
|
||||
DLSUFFICS = .dll
|
||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libeay32MT.lib ssleay32MT.lib
|
||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib
|
||||
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
||||
LIBEXT = .lib
|
||||
LNOUT = /out:
|
||||
EXESUFFICS = .exe
|
||||
@@ -27,10 +28,16 @@ TYPECOMMAND = type
|
||||
COMPATLIBS =
|
||||
MAKEFILE = Makefile.msvc
|
||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin lastFripper FilePlugin
|
||||
|
||||
VERFILE = 3proxyres.obj $(VERFILE)
|
||||
|
||||
include Makefile.inc
|
||||
|
||||
../3proxy.res:
|
||||
rc /fo../3proxy.res ../3proxy.rc
|
||||
|
||||
3proxyres.obj: ../3proxy.res
|
||||
cvtres /out:3proxyres.obj /MACHINE:X86 ../3proxy.res
|
||||
|
||||
allplugins:
|
||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
||||
|
||||
+9
-1
@@ -15,7 +15,8 @@ LN = link
|
||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64
|
||||
DLFLAGS = /DLL
|
||||
DLSUFFICS = .dll
|
||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libeay32MT.lib ssleay32MT.lib
|
||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib
|
||||
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
||||
LIBEXT = .lib
|
||||
LNOUT = /out:
|
||||
EXESUFFICS = .exe
|
||||
@@ -27,9 +28,16 @@ TYPECOMMAND = type
|
||||
COMPATLIBS =
|
||||
MAKEFILE = Makefile.msvc64
|
||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin
|
||||
VERFILE = 3proxyres.obj $(VERFILE)
|
||||
|
||||
include Makefile.inc
|
||||
|
||||
../3proxy.res:
|
||||
rc /fo../3proxy.res ../3proxy.rc
|
||||
|
||||
3proxyres.obj: ../3proxy.res
|
||||
cvtres /out:3proxyres.obj /MACHINE:X64 ../3proxy.res
|
||||
|
||||
allplugins:
|
||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "proxy.h"
|
||||
#ifndef _WIN32
|
||||
#include <sys/resource.h>
|
||||
#ifndef NOPLUGINS
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
@@ -647,6 +648,9 @@ static int h_proxy(int argc, unsigned char ** argv){
|
||||
childdef.isudp = 0;
|
||||
childdef.service = S_PROXY;
|
||||
childdef.helpmessage = " -n - no NTLM support\n";
|
||||
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize)){
|
||||
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, proxy may run very slow\n", linenum);
|
||||
}
|
||||
}
|
||||
else if(!strcmp((char *)argv[0], "pop3p")) {
|
||||
childdef.pf = pop3pchild;
|
||||
@@ -675,6 +679,9 @@ static int h_proxy(int argc, unsigned char ** argv){
|
||||
childdef.isudp = 0;
|
||||
childdef.service = S_SOCKS;
|
||||
childdef.helpmessage = " -n - no NTLM support\n";
|
||||
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize)){
|
||||
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, socks may run very slow\n", linenum);
|
||||
}
|
||||
}
|
||||
else if(!strcmp((char *)argv[0], "tcppm")) {
|
||||
childdef.pf = tcppmchild;
|
||||
@@ -715,6 +722,9 @@ static int h_proxy(int argc, unsigned char ** argv){
|
||||
childdef.port = 53;
|
||||
childdef.isudp = 1;
|
||||
childdef.service = S_DNSPR;
|
||||
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize) || resolvfunc == fakeresolver){
|
||||
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, dnspr will not work as expected\n", linenum);
|
||||
}
|
||||
}
|
||||
return start_proxy_thread(&ch);
|
||||
}
|
||||
@@ -954,6 +964,18 @@ static int h_maxconn(int argc, unsigned char **argv){
|
||||
if(!conf.maxchild) {
|
||||
return(1);
|
||||
}
|
||||
#ifndef _WIN32
|
||||
{
|
||||
struct rlimit rl;
|
||||
if(!getrlimit(RLIMIT_NOFILE, &rl)){
|
||||
if((conf.maxchild<<1) > rl.rlim_cur)
|
||||
fprintf(stderr, "[line %d] Warning: current open file ulimits are too low (cur: %d/max: %d),"
|
||||
" maxconn requires at least %d for every running service."
|
||||
" Configure ulimits according to system documentation\n",
|
||||
linenum, (int)rl.rlim_cur, (int)rl.rlim_max, (conf.maxchild<<1));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
# 3 proxy common Makefile
|
||||
#
|
||||
|
||||
all: pre $(BUILDDIR)3proxy$(EXESUFFICS) $(BUILDDIR)mycrypt$(EXESUFFICS) $(BUILDDIR)dighosts$(EXESUFFICS) $(BUILDDIR)pop3p$(EXESUFFICS) $(BUILDDIR)smtpp$(EXESUFFICS) $(BUILDDIR)ftppr$(EXESUFFICS) $(BUILDDIR)tcppm$(EXESUFFICS) $(BUILDDIR)icqpr$(EXESUFFICS) $(BUILDDIR)msnpr$(EXESUFFICS) $(BUILDDIR)udppm$(EXESUFFICS) $(BUILDDIR)socks$(EXESUFFICS) $(BUILDDIR)proxy$(EXESUFFICS) $(BUILDDIR)countersutil$(EXESUFFICS) allplugins
|
||||
all: pre $(VERFILE) $(BUILDDIR)3proxy$(EXESUFFICS) $(BUILDDIR)mycrypt$(EXESUFFICS) $(BUILDDIR)dighosts$(EXESUFFICS) $(BUILDDIR)pop3p$(EXESUFFICS) $(BUILDDIR)smtpp$(EXESUFFICS) $(BUILDDIR)ftppr$(EXESUFFICS) $(BUILDDIR)tcppm$(EXESUFFICS) $(BUILDDIR)icqpr$(EXESUFFICS) $(BUILDDIR)msnpr$(EXESUFFICS) $(BUILDDIR)udppm$(EXESUFFICS) $(BUILDDIR)socks$(EXESUFFICS) $(BUILDDIR)proxy$(EXESUFFICS) $(BUILDDIR)countersutil$(EXESUFFICS) allplugins
|
||||
|
||||
|
||||
pre:
|
||||
|
||||
-14
@@ -882,20 +882,6 @@ struct auth authfuncs[] = {
|
||||
};
|
||||
|
||||
|
||||
struct hashentry {
|
||||
unsigned char hash[sizeof(unsigned)*4];
|
||||
unsigned long value;
|
||||
time_t expires;
|
||||
struct hashentry *next;
|
||||
};
|
||||
|
||||
struct hashtable {
|
||||
unsigned hashsize;
|
||||
struct hashentry ** hashtable;
|
||||
struct hashentry * hashvalues;
|
||||
struct hashentry * hashempty;
|
||||
};
|
||||
|
||||
struct hashtable dns_table = {0, NULL, NULL, NULL};
|
||||
|
||||
|
||||
|
||||
+4
-6
@@ -42,8 +42,6 @@ void * ftpprchild(struct clientparam* param) {
|
||||
if (req) myfree (req);
|
||||
req = NULL;
|
||||
|
||||
(*param->srv->logfunc)(param, buf);
|
||||
|
||||
if (!strncasecmp((char *)buf, "OPEN ", 5)){
|
||||
if(parsehostname((char *)buf+5, param, 21)){RETURN(803);}
|
||||
if(param->remsock != INVALID_SOCKET) {
|
||||
@@ -123,10 +121,10 @@ void * ftpprchild(struct clientparam* param) {
|
||||
}
|
||||
if ((clidatasock=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN(821);}
|
||||
sasize = sizeof(struct sockaddr_in);
|
||||
if(so._getsockname(param->ctrlsock, (struct sockaddr *)¶m->sinc, &sasize)){RETURN(824);}
|
||||
param->sinc.sin_port = 0;
|
||||
if(so._bind(clidatasock, (struct sockaddr *)¶m->sinc, sasize)){RETURN(822);}
|
||||
if (pasv) {
|
||||
if(so._getsockname(param->ctrlsock, (struct sockaddr *)¶m->sinc, &sasize)){RETURN(824);}
|
||||
param->sinc.sin_port = 0;
|
||||
if(so._bind(clidatasock, (struct sockaddr *)¶m->sinc, sasize)){RETURN(822);}
|
||||
if(so._listen(clidatasock, 1)) {RETURN(823);}
|
||||
if(so._getsockname(clidatasock, (struct sockaddr *)¶m->sinc, &sasize)){RETURN(824);}
|
||||
sprintf((char *)buf, "227 OK (%u,%u,%u,%u,%u,%u)\r\n",
|
||||
@@ -137,7 +135,6 @@ void * ftpprchild(struct clientparam* param) {
|
||||
(unsigned)(((unsigned char *)(¶m->sinc.sin_port))[0]),
|
||||
(unsigned)(((unsigned char *)(¶m->sinc.sin_port))[1])
|
||||
);
|
||||
param->srv->logfunc(param,buf);
|
||||
}
|
||||
else {
|
||||
unsigned long b1, b2, b3, b4;
|
||||
@@ -174,6 +171,7 @@ param->srv->logfunc(param,buf);
|
||||
!(strncasecmp((char *)buf, "RETR ", 5) && (param->operation = FTP_GET)) ||
|
||||
!(strncasecmp((char *)buf, "LIST", 4) && (param->operation = FTP_LIST))||
|
||||
!(strncasecmp((char *)buf, "NLST ", 5) && (param->operation = FTP_LIST)) ||
|
||||
!(strncasecmp((char *)buf, "MLSD", 4) && (param->operation = FTP_LIST)) ||
|
||||
!(strncasecmp((char *)buf, "APPE ", 5) && (param->operation = FTP_PUT)) ||
|
||||
!(strncasecmp((char *)buf, "STOR ", 5) && (param->operation = FTP_PUT))
|
||||
)){
|
||||
|
||||
@@ -105,13 +105,6 @@ int savecouters(void)
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport) int start(struct pluginlink * pluginlink,
|
||||
int argc, char** argv);
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
|
||||
int start(struct pluginlink * pluginlink,
|
||||
@@ -128,6 +121,9 @@ static int ldapfunc(struct clientparam *param)
|
||||
int rc = -1;
|
||||
char tmpbuf[1024];
|
||||
|
||||
/* test proxy user auth ------------------------*/
|
||||
if(!param->username || !param->password) return 4;
|
||||
if(strlen(param->password)==0) return 4;
|
||||
|
||||
/* init ldap ---------------------- */
|
||||
ld = ldap_init( ldap_serv, 389 );
|
||||
@@ -138,9 +134,6 @@ static int ldapfunc(struct clientparam *param)
|
||||
return 7;
|
||||
}
|
||||
|
||||
/* test proxy user auth ------------------------*/
|
||||
if(!param->username || !param->password) return 4;
|
||||
if(strlen(param->password)==0) return 4;
|
||||
|
||||
/* this code for Active Directory LDAP catalog :(
|
||||
detail see documentation for plugin */
|
||||
@@ -168,6 +161,14 @@ static int ldapfunc(struct clientparam *param)
|
||||
ldap_unbind_s(ld);
|
||||
|
||||
ld = ldap_init( ldap_serv, 389 );
|
||||
|
||||
if ( ld == NULL )
|
||||
{
|
||||
param->srv->logfunc(param,"Error ldap_init: No init lib ldap");
|
||||
/*ldap_perror( ld, "Error ldap_init" ); */
|
||||
return 7;
|
||||
}
|
||||
|
||||
rc = ldap_bind_s( ld, ldap_user, ldap_pass, LDAP_AUTH_SIMPLE );
|
||||
|
||||
if ( rc != LDAP_SUCCESS )
|
||||
|
||||
@@ -27,11 +27,6 @@ http://lucas.bergmans.us/hacks/openldap/
|
||||
под unix подобной ОС (Freebsd) использовался стандартный gcc.
|
||||
и библиотеки openldap-client.
|
||||
|
||||
!!!! Внимание при работе плагина возможна утечка памяти !!!!
|
||||
У меня на Win 2000 Serv и окола 600 пользователях при канале 500 кбит/сек .
|
||||
процесс 3proxy за сутки выростает до 40 мб . Лечится рестартом сервиса.
|
||||
Если кто то знает хорошо Open Ldap api и может указать на ошибку в плагине
|
||||
с радостью выслушаю :) .
|
||||
|
||||
|
||||
2. Настройка плагина.
|
||||
@@ -328,11 +323,6 @@ http://lucas.bergmans.us/hacks/openldap/
|
||||
РПД unix РПДПВОПК пу (Freebsd) ЙУРПМШЪПЧБМУС УФБОДБТФОЩК gcc.
|
||||
Й ВЙВМЙПФЕЛЙ openldap-client.
|
||||
|
||||
!!!! чОЙНБОЙЕ РТЙ ТБВПФЕ РМБЗЙОБ ЧПЪНПЦОБ ХФЕЮЛБ РБНСФЙ !!!!
|
||||
х НЕОС ОБ Win 2000 Serv Й ПЛПМБ 600 РПМШЪПЧБФЕМСИ РТЙ ЛБОБМЕ 500 ЛВЙФ/УЕЛ .
|
||||
РТПГЕУУ 3proxy ЪБ УХФЛЙ ЧЩТПУФБЕФ ДП 40 НВ . мЕЮЙФУС ТЕУФБТФПН УЕТЧЙУБ.
|
||||
еУМЙ ЛФП ФП ЪОБЕФ ИПТПЫП Open Ldap api Й НПЦЕФ ХЛБЪБФШ ОБ ПЫЙВЛХ Ч РМБЗЙОЕ
|
||||
У ТБДПУФША ЧЩУМХЫБА :) .
|
||||
|
||||
|
||||
2. оБУФТПКЛБ РМБЗЙОБ.
|
||||
|
||||
@@ -153,7 +153,7 @@ static int restore_old_table(void * v)
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport) int start(struct pluginlink * pluginlink,
|
||||
int argc, char** argv);
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
BOOL WINAPI DllMain( HINSTANCE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
|
||||
@@ -229,7 +229,7 @@ void mylogfunc(struct clientparam * param, const unsigned char * pz) {
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
BOOL APIENTRY DllMain( HANDLE hModule,
|
||||
BOOL WINAPI DllMain( HINSTANCE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
|
||||
@@ -20,14 +20,6 @@ extern "C" {
|
||||
int argc, char** argv);
|
||||
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct auth alwaysauth;
|
||||
|
||||
static char sidbuf[4096];
|
||||
|
||||
@@ -18,15 +18,6 @@ extern "C" {
|
||||
__declspec(dllexport) int utf8tocp1251(struct pluginlink * pluginlink,
|
||||
int argc, char** argv);
|
||||
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct auth alwaysauth;
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -132,8 +132,8 @@ char * proxy_stringtable[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
#define BUFSIZE 4096
|
||||
#define LINESIZE 2048
|
||||
#define LINESIZE 4096
|
||||
#define BUFSIZE (LINESIZE*2)
|
||||
|
||||
static void logurl(struct clientparam * param, char * buf, char * req, int ftp){
|
||||
char *sb;
|
||||
@@ -339,7 +339,7 @@ for(;;){
|
||||
if(!isconnect){
|
||||
if(se==sg)*se-- = ' ';
|
||||
*se = '/';
|
||||
memcpy(ss, se, i - (se - sb) + 1);
|
||||
memmove(ss, se, i - (se - sb) + 1);
|
||||
}
|
||||
}
|
||||
reqlen = i = (int)strlen((char *)buf);
|
||||
@@ -377,7 +377,7 @@ for(;;){
|
||||
continue;
|
||||
}
|
||||
#ifndef NOCRYPT
|
||||
if(!strncasecmp((char *)sb, "ntlm", 4)){
|
||||
if(param->srv->usentlm && !strncasecmp((char *)sb, "ntlm", 4)){
|
||||
sb+=4;
|
||||
while(isspace(*sb))sb++;
|
||||
i = de64(sb, username, 1023);
|
||||
|
||||
+9
-5
@@ -460,22 +460,26 @@ int MODULEMAINFUNC (int argc, char** argv){
|
||||
#else
|
||||
h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)32768, (BEGINTHREADFUNC)srv.pf, (void *) newparam, 0, &thread);
|
||||
#endif
|
||||
newparam->threadid = (unsigned)thread;
|
||||
srv.childcount++;
|
||||
if (h) {
|
||||
srv.childcount++;
|
||||
newparam->threadid = (unsigned)thread;
|
||||
CloseHandle(h);
|
||||
}
|
||||
else {
|
||||
myfree(newparam);
|
||||
sprintf((char *)buf, "_beginthreadex(): %s", _strerror(NULL));
|
||||
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
||||
freeparam(newparam);
|
||||
}
|
||||
#else
|
||||
if((error = pthread_create(&thread, &pa, (PTHREADFUNC)srv.pf, (void *)newparam))){
|
||||
|
||||
error = pthread_create(&thread, &pa, (PTHREADFUNC)srv.pf, (void *)newparam);
|
||||
srv.childcount++;
|
||||
if(error){
|
||||
sprintf((char *)buf, "pthread_create(): %s", strerror(error));
|
||||
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
||||
freeparam(newparam);
|
||||
}
|
||||
else {
|
||||
srv.childcount++;
|
||||
newparam->threadid = (unsigned)thread;
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ int socksendto(SOCKET sock, struct sockaddr_in * sin, unsigned char * buf, int b
|
||||
if(res < 1) break;
|
||||
res = so._sendto(sock, buf + sent, bufsize - sent, 0, (struct sockaddr *)sin, sizeof(struct sockaddr_in));
|
||||
if(res < 0) {
|
||||
if(errno != EAGAIN) break;
|
||||
if(errno != EAGAIN && errno != EINTR) break;
|
||||
continue;
|
||||
}
|
||||
sent += res;
|
||||
|
||||
+8
-4
@@ -130,7 +130,8 @@ int sockmap(struct clientparam * param, int timeo){
|
||||
}
|
||||
res = so._sendto(param->clisock, param->srvbuf + param->srvoffset,(!param->waitserver || ((unsigned)param->waitserver - received) > (param->srvinbuf - param->srvoffset))? param->srvinbuf - param->srvoffset : param->waitserver - received, 0, (struct sockaddr*)¶m->sinc, sasize);
|
||||
if(res < 0) {
|
||||
if(errno != EAGAIN) return 96;
|
||||
if(errno != EAGAIN && errno != EINTR) return 96;
|
||||
if(errno == EINTR) usleep(SLEEPTIME);
|
||||
continue;
|
||||
}
|
||||
param->srvoffset += res;
|
||||
@@ -155,7 +156,8 @@ int sockmap(struct clientparam * param, int timeo){
|
||||
}
|
||||
res = so._sendto(param->remsock, param->clibuf + param->clioffset, (!param->waitclient || ((unsigned)param->waitclient - sent) > (param->cliinbuf - param->clioffset))? param->cliinbuf - param->clioffset : param->waitclient - sent, 0, (struct sockaddr*)¶m->sins, sasize);
|
||||
if(res < 0) {
|
||||
if(errno != EAGAIN) return 97;
|
||||
if(errno != EAGAIN && errno != EINTR) return 97;
|
||||
if(errno == EINTR) usleep(SLEEPTIME);
|
||||
continue;
|
||||
}
|
||||
param->clioffset += res;
|
||||
@@ -180,7 +182,8 @@ int sockmap(struct clientparam * param, int timeo){
|
||||
}
|
||||
else {
|
||||
if (res < 0){
|
||||
if( errno != EAGAIN) return (94);
|
||||
if(errno != EAGAIN && errno != EINTR) return 94;
|
||||
if(errno == EINTR) usleep(SLEEPTIME);
|
||||
continue;
|
||||
}
|
||||
param->cliinbuf += res;
|
||||
@@ -210,7 +213,8 @@ int sockmap(struct clientparam * param, int timeo){
|
||||
}
|
||||
else {
|
||||
if (res < 0){
|
||||
if( errno != EAGAIN) return (93);
|
||||
if(errno != EAGAIN && errno != EINTR) return 93;
|
||||
if(errno == EINTR) usleep(SLEEPTIME);
|
||||
continue;
|
||||
}
|
||||
param->srvinbuf += res;
|
||||
|
||||
@@ -657,6 +657,19 @@ typedef enum {
|
||||
TYPE_SERVER
|
||||
}DATA_TYPE;
|
||||
|
||||
struct hashentry {
|
||||
unsigned char hash[sizeof(unsigned)*4];
|
||||
unsigned long value;
|
||||
time_t expires;
|
||||
struct hashentry *next;
|
||||
};
|
||||
|
||||
struct hashtable {
|
||||
unsigned hashsize;
|
||||
struct hashentry ** hashtable;
|
||||
struct hashentry * hashvalues;
|
||||
struct hashentry * hashempty;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#define VERSION "3proxy-0.7.1.1"
|
||||
#define BUILDDATE "140702135419"
|
||||
Reference in new issue
Block a user