mirror of
https://github.com/3proxy/3proxy.git
synced 2026-06-15 12:00:10 +08:00
Compare commits
1 Commits
bfbbf1f446
...
8bf0d3f4ae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bf0d3f4ae |
@ -168,7 +168,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
StringsPlugin
|
StringsPlugin
|
||||||
TrafficPlugin
|
TrafficPlugin
|
||||||
TransparentPlugin
|
TransparentPlugin
|
||||||
FilePlugin
|
|
||||||
)
|
)
|
||||||
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Darwin|OpenBSD|NetBSD")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Darwin|OpenBSD|NetBSD")
|
||||||
@ -190,7 +189,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Darwin|OpenBSD|NetBSD")
|
|||||||
StringsPlugin
|
StringsPlugin
|
||||||
TrafficPlugin
|
TrafficPlugin
|
||||||
TransparentPlugin
|
TransparentPlugin
|
||||||
FilePlugin
|
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
@ -207,7 +205,6 @@ else()
|
|||||||
StringsPlugin
|
StringsPlugin
|
||||||
TrafficPlugin
|
TrafficPlugin
|
||||||
TransparentPlugin
|
TransparentPlugin
|
||||||
FilePlugin
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Mak
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.FreeBSD
|
MAKEFILE = Makefile.FreeBSD
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin FilePlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
LIBS += -l crypto -l ssl
|
LIBS += -l crypto -l ssl
|
||||||
|
|||||||
@ -32,7 +32,7 @@ MAKEFILE = Makefile.Linux
|
|||||||
#LIBS = -lcrypto -lssl -ldl
|
#LIBS = -lcrypto -lssl -ldl
|
||||||
LIBS ?= -ldl
|
LIBS ?= -ldl
|
||||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin FilePlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
LIBS += -l crypto -l ssl
|
LIBS += -l crypto -l ssl
|
||||||
|
|||||||
@ -31,7 +31,7 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Mak
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.unix
|
MAKEFILE = Makefile.unix
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin FilePlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
LIBS += -l crypto -l ssl
|
LIBS += -l crypto -l ssl
|
||||||
|
|||||||
@ -26,7 +26,7 @@ REMOVECOMMAND = rm -f
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.win
|
MAKEFILE = Makefile.win
|
||||||
PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin
|
PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin
|
||||||
VERFILE := 3proxyres.o $(VERFILE)
|
VERFILE := 3proxyres.o $(VERFILE)
|
||||||
VERSION := $(VERSION)
|
VERSION := $(VERSION)
|
||||||
VERSIONDEP := 3proxyres.o $(VERSIONDEP)
|
VERSIONDEP := 3proxyres.o $(VERSIONDEP)
|
||||||
|
|||||||
12
src/hash.c
12
src/hash.c
@ -143,7 +143,7 @@ void hashadd(struct hashtable *ht, const void* name, const void* value, time_t e
|
|||||||
uint32_t hen, he;
|
uint32_t hen, he;
|
||||||
uint32_t *hep;
|
uint32_t *hep;
|
||||||
int overwrite = 0;
|
int overwrite = 0;
|
||||||
uint8_t hash[MAX_HASH_SIZE];
|
uint8_t hash[ht->hash_size];
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
uint32_t last = 0;
|
uint32_t last = 0;
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ void hashadd(struct hashtable *ht, const void* name, const void* value, time_t e
|
|||||||
}
|
}
|
||||||
|
|
||||||
int hashresolv(struct hashtable *ht, const void* name, void* value, uint32_t *ttl){
|
int hashresolv(struct hashtable *ht, const void* name, void* value, uint32_t *ttl){
|
||||||
uint8_t hash[MAX_HASH_SIZE];
|
uint8_t hash[ht->hash_size];
|
||||||
uint32_t *hep;
|
uint32_t *hep;
|
||||||
uint32_t he;
|
uint32_t he;
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
@ -231,7 +231,7 @@ void param2hash(const struct hashtable *ht, const void *index, uint8_t *hash){
|
|||||||
blake2b_state S;
|
blake2b_state S;
|
||||||
const struct clientparam *param = (struct clientparam *)index;
|
const struct clientparam *param = (struct clientparam *)index;
|
||||||
|
|
||||||
blake2b_init(&S, ht->hash_size);
|
blake2b_init(&S, HASH_SIZE);
|
||||||
if((conf.authcachetype & 2) && param->username)blake2b_update(&S, param->username, strlen((const char *)param->username) + 1);
|
if((conf.authcachetype & 2) && param->username)blake2b_update(&S, param->username, strlen((const char *)param->username) + 1);
|
||||||
if((conf.authcachetype & 4) && param->password)blake2b_update(&S, param->password, strlen((const char *)param->password) + 1);
|
if((conf.authcachetype & 4) && param->password)blake2b_update(&S, param->password, strlen((const char *)param->password) + 1);
|
||||||
if((conf.authcachetype & 1) && !(conf.authcachetype & 8))blake2b_update(&S, SAADDR(¶m->sincr), SAADDRLEN(¶m->sincr));
|
if((conf.authcachetype & 1) && !(conf.authcachetype & 8))blake2b_update(&S, SAADDR(¶m->sincr), SAADDRLEN(¶m->sincr));
|
||||||
@ -239,6 +239,6 @@ void param2hash(const struct hashtable *ht, const void *index, uint8_t *hash){
|
|||||||
blake2b_final(&S, hash, ht->hash_size);
|
blake2b_final(&S, hash, ht->hash_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hashtable dns_table = {char_index2hash, 4, 16};
|
struct hashtable dns_table = {char_index2hash, 4, HASH_SIZE};
|
||||||
struct hashtable dns6_table = {char_index2hash, 16, 16};
|
struct hashtable dns6_table = {char_index2hash, 16, HASH_SIZE};
|
||||||
struct hashtable auth_table = {param2hash, sizeof(struct authcache), 16};
|
struct hashtable auth_table = {param2hash, sizeof(struct authcache), HASH_SIZE};
|
||||||
|
|||||||
@ -287,7 +287,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){
|
|||||||
case GOT_SMTP_REQ:
|
case GOT_SMTP_REQ:
|
||||||
case GOT_SMTP_DATA:
|
case GOT_SMTP_DATA:
|
||||||
fps->state = FLUSH_DATA;
|
fps->state = FLUSH_DATA;
|
||||||
pl->socksend(fps->fpd.cp->sostate,fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
pl->socksend(fps->fpd.cp->sostate,fps->fpd.cp->clisock, fp_stringtable[1], (int)strlen(fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
break;
|
break;
|
||||||
case GOT_HTTP_REQUEST:
|
case GOT_HTTP_REQUEST:
|
||||||
@ -299,7 +299,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){
|
|||||||
case GOT_HTTP_SRVDATA:
|
case GOT_HTTP_SRVDATA:
|
||||||
if(!fps->serversent){
|
if(!fps->serversent){
|
||||||
fps->state = FLUSH_DATA;
|
fps->state = FLUSH_DATA;
|
||||||
pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[0], (int)strlen((char *)fp_stringtable[0]), pl->conf->timeouts[STRING_S]);
|
pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, fp_stringtable[0], (int)strlen(fp_stringtable[0]), pl->conf->timeouts[STRING_S]);
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -307,7 +307,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){
|
|||||||
case GOT_FTP_REQ:
|
case GOT_FTP_REQ:
|
||||||
case GOT_FTP_SRVDATA:
|
case GOT_FTP_SRVDATA:
|
||||||
fps->state = FLUSH_DATA;
|
fps->state = FLUSH_DATA;
|
||||||
pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->ctrlsock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->ctrlsock, fp_stringtable[1], (int)strlen(fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -359,7 +359,7 @@ static int copyfdtosock(struct fp_stream * fps, DIRECTION which, long len){
|
|||||||
if(fps->serversent >= fps->srvhdrwritten){
|
if(fps->serversent >= fps->srvhdrwritten){
|
||||||
sprintf(fps->buf, "%lx\r\n", len);
|
sprintf(fps->buf, "%lx\r\n", len);
|
||||||
sendchunk = (int)strlen(fps->buf);
|
sendchunk = (int)strlen(fps->buf);
|
||||||
if(pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, (unsigned char *)fps->buf, sendchunk, pl->conf->timeouts[STRING_S]) != sendchunk){
|
if(pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, fps->buf, sendchunk, pl->conf->timeouts[STRING_S]) != sendchunk){
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -398,24 +398,20 @@ static int copyfdtosock(struct fp_stream * fps, DIRECTION which, long len){
|
|||||||
#endif
|
#endif
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
if(pl->socksend(fps->fpd.cp->sostate, sock, (unsigned char *)fps->buf, res, pl->conf->timeouts[STRING_S]) != res) {
|
if(pl->socksend(fps->fpd.cp->sostate, sock, fps->buf, res, pl->conf->timeouts[STRING_S]) != res) {
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
len -= res;
|
len -= res;
|
||||||
}
|
}
|
||||||
if(sendchunk){
|
if(sendchunk){
|
||||||
if(pl->socksend(fps->fpd.cp->sostate, sock, (unsigned char *)"\r\n", 2, pl->conf->timeouts[STRING_S]) != 2)
|
if(pl->socksend(fps->fpd.cp->sostate, sock, "\r\n", 2, pl->conf->timeouts[STRING_S]) != 2)
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
static int WINAPI fp_poll(void *state, struct pollfd *fds, unsigned int nfds, int timeout){
|
static int WINAPI fp_poll(void *state, struct pollfd *fds, unsigned int nfds, int timeout){
|
||||||
#else
|
|
||||||
static int fp_poll(void *state, struct pollfd *fds, nfds_t nfds, int timeout){
|
|
||||||
#endif
|
|
||||||
struct fp_stream *fps = NULL;
|
struct fp_stream *fps = NULL;
|
||||||
int res;
|
int res;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@ -462,11 +458,7 @@ static int fp_poll(void *state, struct pollfd *fds, nfds_t nfds, int timeout){
|
|||||||
return sso._poll(sso.state, fds, nfds, timeout);
|
return sso._poll(sso.state, fds, nfds, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
static fp_ssize_t WINAPI fp_send(void *state, SOCKET s, const char *msg, fp_size_t len, int flags){
|
||||||
static int WINAPI fp_send(void *state, SOCKET s, const char *msg, int len, int flags){
|
|
||||||
#else
|
|
||||||
static fp_ssize_t fp_send(void *state, SOCKET s, const void *msg, size_t len, int flags){
|
|
||||||
#endif
|
|
||||||
struct fp_stream *fps = NULL;
|
struct fp_stream *fps = NULL;
|
||||||
int res;
|
int res;
|
||||||
res = searchsocket(s, &fps);
|
res = searchsocket(s, &fps);
|
||||||
@ -507,7 +499,7 @@ static fp_ssize_t fp_send(void *state, SOCKET s, const void *msg, size_t len, in
|
|||||||
int hasnonzero = 0, i;
|
int hasnonzero = 0, i;
|
||||||
|
|
||||||
for(i=0; i < len; i++){
|
for(i=0; i < len; i++){
|
||||||
char c = ((char *)msg)[i];
|
char c = msg[i];
|
||||||
|
|
||||||
if(c == '\r' || c == '\n') continue;
|
if(c == '\r' || c == '\n') continue;
|
||||||
if((c<'0'|| c>'9') && (c<'A' || c>'F') && (c<'a' || c>'f')) {
|
if((c<'0'|| c>'9') && (c<'A' || c>'F') && (c<'a' || c>'f')) {
|
||||||
@ -550,12 +542,7 @@ static fp_ssize_t fp_send(void *state, SOCKET s, const void *msg, size_t len, in
|
|||||||
}
|
}
|
||||||
return sso._send(sso.state, s, msg, len, flags);
|
return sso._send(sso.state, s, msg, len, flags);
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
static fp_ssize_t WINAPI fp_sendto(void *state, SOCKET s, const void *msg, int len, int flags, const struct sockaddr *to, fp_size_t tolen){
|
||||||
static int WINAPI fp_sendto(void *state, SOCKET s, const char *msg, int len, int flags, const struct sockaddr *to, int tolen
|
|
||||||
#else
|
|
||||||
static fp_ssize_t fp_sendto(void *state, SOCKET s, const void *msg, fp_size_t len, int flags, const struct sockaddr *to, SASIZETYPE tolen
|
|
||||||
#endif
|
|
||||||
){
|
|
||||||
struct fp_stream *fps = NULL;
|
struct fp_stream *fps = NULL;
|
||||||
int res;
|
int res;
|
||||||
res = searchsocket(s, &fps);
|
res = searchsocket(s, &fps);
|
||||||
@ -673,20 +660,10 @@ static fp_ssize_t fp_sendto(void *state, SOCKET s, const void *msg, fp_size_t le
|
|||||||
}
|
}
|
||||||
return sso._sendto(sso.state, s, msg, len, flags, to, tolen);
|
return sso._sendto(sso.state, s, msg, len, flags, to, tolen);
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
static fp_ssize_t WINAPI fp_recv(void *state, SOCKET s, void *buf, fp_size_t len, int flags){
|
||||||
static int WINAPI fp_recv(void *state, SOCKET s, char *buf, int len, int flags
|
|
||||||
#else
|
|
||||||
static fp_ssize_t fp_recv(void *state, SOCKET s, void *buf, fp_size_t len, int flags
|
|
||||||
#endif
|
|
||||||
){
|
|
||||||
return sso._recv(sso.state, s, buf, len, flags);
|
return sso._recv(sso.state, s, buf, len, flags);
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
static fp_ssize_t WINAPI fp_recvfrom(void *state, SOCKET s, void * buf, fp_size_t len, int flags, struct sockaddr * from, fp_size_t * fromlen){
|
||||||
static int WINAPI fp_recvfrom(void *state, SOCKET s, char *buf, int len, int flags, struct sockaddr * from, int * fromlen
|
|
||||||
#else
|
|
||||||
static fp_ssize_t fp_recvfrom(void *state, SOCKET s, void *buf, fp_size_t len, int flags, struct sockaddr * from, SASIZETYPE * fromlen
|
|
||||||
#endif
|
|
||||||
){
|
|
||||||
return sso._recvfrom(sso.state, s, buf, len, flags, from, fromlen);
|
return sso._recvfrom(sso.state, s, buf, len, flags, from, fromlen);
|
||||||
}
|
}
|
||||||
static int WINAPI fp_shutdown(void *state, SOCKET s, int how){
|
static int WINAPI fp_shutdown(void *state, SOCKET s, int how){
|
||||||
@ -789,7 +766,7 @@ static FILTER_ACTION fp_request(void *fc, struct clientparam * param, unsigned c
|
|||||||
closefiles(FC);
|
closefiles(FC);
|
||||||
FC->state = 0;
|
FC->state = 0;
|
||||||
}
|
}
|
||||||
processcallbacks(FC, FP_CALLONREQUEST, (char *)*buf_p + offset, *length_p - offset);
|
processcallbacks(FC, FP_CALLONREQUEST, *buf_p + offset, *length_p - offset);
|
||||||
if(FC->what &FP_REJECT) return REJECT;
|
if(FC->what &FP_REJECT) return REJECT;
|
||||||
FC->state = GOT_HTTP_REQUEST;
|
FC->state = GOT_HTTP_REQUEST;
|
||||||
genpaths(FC);
|
genpaths(FC);
|
||||||
@ -801,13 +778,13 @@ static FILTER_ACTION fp_request(void *fc, struct clientparam * param, unsigned c
|
|||||||
|
|
||||||
static FILTER_ACTION fp_hcli(void *fc, struct clientparam * param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p){
|
static FILTER_ACTION fp_hcli(void *fc, struct clientparam * param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p){
|
||||||
if(fc && param->service == S_SMTPP) {
|
if(fc && param->service == S_SMTPP) {
|
||||||
processcallbacks(FC, FP_CALLONREQUEST, (char *)*buf_p + offset, *length_p - offset);
|
processcallbacks(FC, FP_CALLONREQUEST, *buf_p + offset, *length_p - offset);
|
||||||
if(FC->what & FP_REJECT) return REJECT;
|
if(FC->what & FP_REJECT) return REJECT;
|
||||||
if(!FC->state)genpaths(FC);
|
if(!FC->state)genpaths(FC);
|
||||||
FC->state = GOT_SMTP_REQ;
|
FC->state = GOT_SMTP_REQ;
|
||||||
}
|
}
|
||||||
if(fc && param->service == S_FTPPR) {
|
if(fc && param->service == S_FTPPR) {
|
||||||
processcallbacks(FC, FP_CALLONREQUEST, (char *)*buf_p + offset, *length_p - offset);
|
processcallbacks(FC, FP_CALLONREQUEST, *buf_p + offset, *length_p - offset);
|
||||||
if(FC->what & FP_REJECT) return REJECT;
|
if(FC->what & FP_REJECT) return REJECT;
|
||||||
genpaths(FC);
|
genpaths(FC);
|
||||||
FC->state = GOT_FTP_REQ;
|
FC->state = GOT_FTP_REQ;
|
||||||
@ -875,7 +852,7 @@ static int h_cachedir(int argc, unsigned char **argv){
|
|||||||
char * dirp;
|
char * dirp;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
dirp = (argc > 1)? (char *)argv[1] : getenv("TEMP");
|
dirp = (argc > 1)? argv[1] : getenv("TEMP");
|
||||||
len = strlen(dirp);
|
len = strlen(dirp);
|
||||||
if(!dirp || !len || len > 200 || strchr(dirp, '%')) {
|
if(!dirp || !len || len > 200 || strchr(dirp, '%')) {
|
||||||
fprintf(stderr, "FilePlugin: invalid directory path: %s\n", dirp);
|
fprintf(stderr, "FilePlugin: invalid directory path: %s\n", dirp);
|
||||||
@ -892,7 +869,7 @@ static int h_cachedir(int argc, unsigned char **argv){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int h_preview(int argc, unsigned char **argv){
|
static int h_preview(int argc, unsigned char **argv){
|
||||||
preview = atoi((char *)argv[1]);
|
preview = atoi(argv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ int mutex_unlock(int *val);
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <Ws2tcpip.h>
|
||||||
#define pthread_mutex_t CRITICAL_SECTION
|
#define pthread_mutex_t CRITICAL_SECTION
|
||||||
#define pthread_mutex_init(x, y) InitializeCriticalSection(x)
|
#define pthread_mutex_init(x, y) InitializeCriticalSection(x)
|
||||||
#define pthread_mutex_lock(x) EnterCriticalSection(x)
|
#define pthread_mutex_lock(x) EnterCriticalSection(x)
|
||||||
@ -754,7 +754,7 @@ struct child {
|
|||||||
unsigned char **argv;
|
unsigned char **argv;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_HASH_SIZE (16)
|
#define HASH_SIZE (16)
|
||||||
|
|
||||||
struct hashtable {
|
struct hashtable {
|
||||||
void (*index2hash)(const struct hashtable *ht, const void *index, uint8_t *hash);
|
void (*index2hash)(const struct hashtable *ht, const void *index, uint8_t *hash);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user