mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
25
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db169c48c3 | ||
|
|
206e00c933 | ||
|
|
98961ced0d | ||
|
|
de8de757f6 | ||
|
|
e935d1f6d1 | ||
|
|
1be182c65f | ||
|
|
5ef18c48f1 | ||
|
|
c3871caf2a | ||
|
|
f649c7d4de | ||
|
|
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 ..\..)
|
||||
|
||||
+23
-2
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "proxy.h"
|
||||
#ifndef _WIN32
|
||||
#include <sys/resource.h>
|
||||
#ifndef NOPLUGINS
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
@@ -359,9 +360,8 @@ unsigned char * dologname (unsigned char *buf, unsigned char *name, const unsign
|
||||
|
||||
memset(&fakecli, 0, sizeof(fakecli));
|
||||
dobuf2(&fakecli, buf, NULL, NULL, ts, (char *)name);
|
||||
return buf;
|
||||
}
|
||||
switch(lt){
|
||||
else switch(lt){
|
||||
case NONE:
|
||||
sprintf((char *)buf, "%s", name);
|
||||
break;
|
||||
@@ -647,6 +647,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 +678,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 +721,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 +963,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:
|
||||
|
||||
+8
-15
@@ -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};
|
||||
|
||||
|
||||
@@ -936,6 +922,7 @@ int inithashtable(struct hashtable *ht, unsigned nhashsize){
|
||||
unsigned i;
|
||||
|
||||
if(nhashsize<4) return 1;
|
||||
pthread_mutex_lock(&hash_mutex);
|
||||
if(ht->hashtable){
|
||||
myfree(ht->hashtable);
|
||||
ht->hashtable = NULL;
|
||||
@@ -946,11 +933,13 @@ int inithashtable(struct hashtable *ht, unsigned nhashsize){
|
||||
}
|
||||
ht->hashsize = 0;
|
||||
if(!(ht->hashtable = myalloc((nhashsize>>2) * sizeof(struct hashentry *)))){
|
||||
pthread_mutex_unlock(&hash_mutex);
|
||||
return 2;
|
||||
}
|
||||
if(!(ht->hashvalues = myalloc(nhashsize * sizeof(struct hashentry)))){
|
||||
myfree(ht->hashtable);
|
||||
ht->hashtable = NULL;
|
||||
pthread_mutex_unlock(&hash_mutex);
|
||||
return 3;
|
||||
}
|
||||
ht->hashsize = nhashsize;
|
||||
@@ -960,6 +949,7 @@ int inithashtable(struct hashtable *ht, unsigned nhashsize){
|
||||
(ht->hashvalues + i)->next = ht->hashvalues + i + 1;
|
||||
}
|
||||
ht->hashempty = ht->hashvalues;
|
||||
pthread_mutex_unlock(&hash_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -971,8 +961,11 @@ void hashadd(struct hashtable *ht, const unsigned char* name, unsigned long valu
|
||||
struct hashentry * he;
|
||||
unsigned index;
|
||||
|
||||
if(!value||!name||!ht->hashtable||!ht->hashempty) return;
|
||||
pthread_mutex_lock(&hash_mutex);
|
||||
if(!value||!name||!ht->hashtable||!ht->hashempty){
|
||||
pthread_mutex_unlock(&hash_mutex);
|
||||
return;
|
||||
}
|
||||
he = ht->hashempty;
|
||||
ht->hashempty = ht->hashempty->next;
|
||||
nametohash(name, he->hash);
|
||||
|
||||
+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))
|
||||
)){
|
||||
|
||||
@@ -49,7 +49,7 @@ static pthread_mutex_t file_mutex;
|
||||
|
||||
unsigned long preview = 0;
|
||||
|
||||
char path[256];
|
||||
char path[300];
|
||||
|
||||
static int counter = 0;
|
||||
static int timeo = 0;
|
||||
@@ -876,13 +876,15 @@ __declspec(dllexport)
|
||||
fp_symbols[1].next = pl->symbols.next;
|
||||
pl->symbols.next = fp_symbols;
|
||||
}
|
||||
if(path) free(path);
|
||||
dirp = (argc > 1)? argv[1] : getenv("TEMP");
|
||||
if(strlen(dirp) > 200 || strchr(dirp, '%')) return (13001);
|
||||
if(strlen(dirp) > 200 || strchr(dirp, '%')) {
|
||||
fprintf(stderr, "FilePlugin: invalid directory path: %s\n", dirp);
|
||||
return (13001);
|
||||
}
|
||||
#ifdef _WIN32
|
||||
sprintf(path, "%s\\%%d.tmp", dirp);
|
||||
sprintf(path, "%.256s\\%%07d.tmp", dirp);
|
||||
#else
|
||||
sprintf(path, "%s/%%d.tmp", dirp);
|
||||
sprintf(path, "%.256s/%%07d.tmp", dirp);
|
||||
#endif
|
||||
if(argc > 2) preview = atoi(argv[2]);
|
||||
if(!preview) preview = 32768;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
+6
-6
@@ -119,7 +119,7 @@ char * proxy_stringtable[] = {
|
||||
"<body><h2>503 Service Unavailable</h2><h3>Your request violates configured policy</h3></body></html>\r\n",
|
||||
|
||||
/* 16*/ "HTTP/1.0 401 Authentication Required\r\n"
|
||||
"Proxy-Authenticate: basic realm=\"FTP Server\"\r\n"
|
||||
"WWW-Authenticate: basic realm=\"FTP Server\"\r\n"
|
||||
"Proxy-Connection: close\r\n"
|
||||
"Content-type: text/html; charset=us-ascii\r\n"
|
||||
"\r\n"
|
||||
@@ -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);
|
||||
@@ -464,7 +464,7 @@ for(;;){
|
||||
}
|
||||
if(se)*se = '\r';
|
||||
}
|
||||
if(ftp && i > 19 && (!strncasecmp((char *)(buf+inbuf), "authorization", 19))){
|
||||
if(ftp && i > 13 && (!strncasecmp((char *)(buf+inbuf), "authorization", 13))){
|
||||
sb = (unsigned char *)strchr((char *)(buf+inbuf), ':');
|
||||
if(!sb)continue;
|
||||
++sb;
|
||||
|
||||
+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.3"
|
||||
#define BUILDDATE "150916004303"
|
||||
+2
-2
@@ -480,9 +480,9 @@ void * adminchild(struct clientparam* param) {
|
||||
"<td>MB%s</td>"
|
||||
"<td>%.3f MB</td>"
|
||||
"<td>%s</td>",
|
||||
(1024.0 * (float)cp->traflimgb) + (float)cp->traflim/1048576.0,
|
||||
(4 * 1024.0 * (float)cp->traflimgb) + (float)cp->traflim/(1024.*1024.),
|
||||
rotations[cp->type],
|
||||
(1024.0 * (float)cp->trafgb) + (float)cp->traf/1048576.0,
|
||||
(4 * 1024.0 * (float)cp->trafgb) + (float)cp->traf/(1024.*1024.),
|
||||
cp->cleared?ctime(&cp->cleared):"never"
|
||||
);
|
||||
inbuf += sprintf(buf + inbuf,
|
||||
|
||||
Reference in new issue
Block a user