mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20997d759d |
No files matched your search
+2
-6
@@ -19,9 +19,7 @@ LDFLAGS = -Wall -O2 -pthread
|
||||
DLFLAGS = -shared
|
||||
DLSUFFICS = .ld.so
|
||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||
#LIBS = -lcrypto -lssl -ldl
|
||||
# libcrypto and libssl are required for SSLPlugin
|
||||
LIBS = -ldl
|
||||
LIBS = -lcrypto -lssl -ldl
|
||||
LNOUT = -o
|
||||
EXESUFFICS =
|
||||
OBJSUFFICS = .o
|
||||
@@ -31,9 +29,7 @@ REMOVECOMMAND = rm -f
|
||||
TYPECOMMAND = cat
|
||||
COMPATLIBS =
|
||||
MAKEFILE = Makefile.Linux
|
||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
# SSLPlugin is not built by default because of external dependencies
|
||||
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
|
||||
include Makefile.inc
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "proxy.h"
|
||||
#ifndef _WIN32
|
||||
#include <sys/resource.h>
|
||||
#ifndef NOPLUGINS
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
@@ -360,8 +359,9 @@ 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;
|
||||
}
|
||||
else switch(lt){
|
||||
switch(lt){
|
||||
case NONE:
|
||||
sprintf((char *)buf, "%s", name);
|
||||
break;
|
||||
|
||||
+1
-8
@@ -922,7 +922,6 @@ 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;
|
||||
@@ -933,13 +932,11 @@ 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;
|
||||
@@ -949,7 +946,6 @@ 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;
|
||||
}
|
||||
|
||||
@@ -961,11 +957,8 @@ 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);
|
||||
|
||||
@@ -49,7 +49,7 @@ static pthread_mutex_t file_mutex;
|
||||
|
||||
unsigned long preview = 0;
|
||||
|
||||
char path[300];
|
||||
char path[256];
|
||||
|
||||
static int counter = 0;
|
||||
static int timeo = 0;
|
||||
@@ -876,15 +876,13 @@ __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, '%')) {
|
||||
fprintf(stderr, "FilePlugin: invalid directory path: %s\n", dirp);
|
||||
return (13001);
|
||||
}
|
||||
if(strlen(dirp) > 200 || strchr(dirp, '%')) return (13001);
|
||||
#ifdef _WIN32
|
||||
sprintf(path, "%.256s\\%%07d.tmp", dirp);
|
||||
sprintf(path, "%s\\%%d.tmp", dirp);
|
||||
#else
|
||||
sprintf(path, "%.256s/%%07d.tmp", dirp);
|
||||
sprintf(path, "%s/%%d.tmp", dirp);
|
||||
#endif
|
||||
if(argc > 2) preview = atoi(argv[2]);
|
||||
if(!preview) preview = 32768;
|
||||
|
||||
+4
-5
@@ -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"
|
||||
"WWW-Authenticate: basic realm=\"FTP Server\"\r\n"
|
||||
"Proxy-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 LINESIZE 4096
|
||||
#define BUFSIZE (LINESIZE*2)
|
||||
#define BUFSIZE 4096
|
||||
#define LINESIZE 2048
|
||||
|
||||
static void logurl(struct clientparam * param, char * buf, char * req, int ftp){
|
||||
char *sb;
|
||||
@@ -300,7 +300,6 @@ for(;;){
|
||||
|
||||
if ((sb=(unsigned char *)(unsigned char *)strchr((char *)buf, ' ')) == NULL) {RETURN(512);}
|
||||
ss = ++sb;
|
||||
param->transparent = 0;
|
||||
if(!isconnect) {
|
||||
if (!strncasecmp((char *)sb, "http://", 7)) {
|
||||
sb += 7;
|
||||
@@ -465,7 +464,7 @@ for(;;){
|
||||
}
|
||||
if(se)*se = '\r';
|
||||
}
|
||||
if(ftp && i > 13 && (!strncasecmp((char *)(buf+inbuf), "authorization", 13))){
|
||||
if(ftp && i > 19 && (!strncasecmp((char *)(buf+inbuf), "authorization", 19))){
|
||||
sb = (unsigned char *)strchr((char *)(buf+inbuf), ':');
|
||||
if(!sb)continue;
|
||||
++sb;
|
||||
|
||||
+5
-9
@@ -460,26 +460,22 @@ int MODULEMAINFUNC (int argc, char** argv){
|
||||
#else
|
||||
h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)32768, (BEGINTHREADFUNC)srv.pf, (void *) newparam, 0, &thread);
|
||||
#endif
|
||||
srv.childcount++;
|
||||
newparam->threadid = (unsigned)thread;
|
||||
if (h) {
|
||||
newparam->threadid = (unsigned)thread;
|
||||
srv.childcount++;
|
||||
CloseHandle(h);
|
||||
}
|
||||
else {
|
||||
sprintf((char *)buf, "_beginthreadex(): %s", _strerror(NULL));
|
||||
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
||||
freeparam(newparam);
|
||||
myfree(newparam);
|
||||
}
|
||||
#else
|
||||
|
||||
error = pthread_create(&thread, &pa, (PTHREADFUNC)srv.pf, (void *)newparam);
|
||||
srv.childcount++;
|
||||
if(error){
|
||||
if((error = pthread_create(&thread, &pa, (PTHREADFUNC)srv.pf, (void *)newparam))){
|
||||
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
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
#define VERSION "3proxy-0.7.1.4"
|
||||
#define BUILDDATE "160123190051"
|
||||
#define VERSION "3proxy-0.7.1"
|
||||
#define BUILDDATE "140628175321"
|
||||
+2
-2
@@ -480,9 +480,9 @@ void * adminchild(struct clientparam* param) {
|
||||
"<td>MB%s</td>"
|
||||
"<td>%.3f MB</td>"
|
||||
"<td>%s</td>",
|
||||
(4 * 1024.0 * (float)cp->traflimgb) + (float)cp->traflim/(1024.*1024.),
|
||||
(1024.0 * (float)cp->traflimgb) + (float)cp->traflim/1048576.0,
|
||||
rotations[cp->type],
|
||||
(4 * 1024.0 * (float)cp->trafgb) + (float)cp->traf/(1024.*1024.),
|
||||
(1024.0 * (float)cp->trafgb) + (float)cp->traf/1048576.0,
|
||||
cp->cleared?ctime(&cp->cleared):"never"
|
||||
);
|
||||
inbuf += sprintf(buf + inbuf,
|
||||
|
||||
Reference in new issue
Block a user