mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db169c48c3 | ||
|
|
206e00c933 | ||
|
|
98961ced0d | ||
|
|
de8de757f6 | ||
|
|
e935d1f6d1 | ||
|
|
1be182c65f |
No files matched your search
+8
-1
@@ -922,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;
|
||||
@@ -932,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;
|
||||
@@ -946,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;
|
||||
}
|
||||
|
||||
@@ -957,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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
+2
-2
@@ -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"
|
||||
@@ -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;
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
#define VERSION "3proxy-0.7.1.2"
|
||||
#define BUILDDATE "150217161415"
|
||||
#define VERSION "3proxy-0.7.1.3"
|
||||
#define BUILDDATE "150916004303"
|
||||
Reference in new issue
Block a user