mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-28 15:10:12 +08:00
Fix for older Windows (7 and below) / VC
This commit is contained in:
parent
e6c3427cab
commit
6b61cfde4c
@ -823,7 +823,7 @@ int doauth(struct clientparam * param){
|
|||||||
(res = (*authfuncs->authorize)(param)))
|
(res = (*authfuncs->authorize)(param)))
|
||||||
return res;
|
return res;
|
||||||
if(conf.authcachetype && authfuncs->authenticate && authfuncs->authenticate != cacheauth && param->username && (!(conf.authcachetype&4) || (!param->pwtype && param->password))){
|
if(conf.authcachetype && authfuncs->authenticate && authfuncs->authenticate != cacheauth && param->username && (!(conf.authcachetype&4) || (!param->pwtype && param->password))){
|
||||||
struct authcache ac={};
|
struct authcache ac={.username=""};
|
||||||
|
|
||||||
if(param->username) strncpy((char *)ac.username, (char *)param->username, 64);
|
if(param->username) strncpy((char *)ac.username, (char *)param->username, 64);
|
||||||
if(*SAFAMILY(¶m->sincr) == AF_INET
|
if(*SAFAMILY(¶m->sincr) == AF_INET
|
||||||
|
|||||||
@ -153,6 +153,7 @@ int start_proxy_thread(struct child * chp){
|
|||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HANDLE h;
|
HANDLE h;
|
||||||
|
DWORD num;
|
||||||
#endif
|
#endif
|
||||||
char r[1];
|
char r[1];
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ int start_proxy_thread(struct child * chp){
|
|||||||
pthread_attr_destroy(&pa);
|
pthread_attr_destroy(&pa);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
ReadFile(conf.threadinit[0], r, 1, NULL, NULL);
|
ReadFile(conf.threadinit[0], r, 1, &num, NULL);
|
||||||
#else
|
#else
|
||||||
while(read(conf.threadinit[0], r, 1) !=1) if(errno != EINTR) {
|
while(read(conf.threadinit[0], r, 1) !=1) if(errno != EINTR) {
|
||||||
fprintf(stderr, "pipe failed\n");
|
fprintf(stderr, "pipe failed\n");
|
||||||
|
|||||||
@ -279,7 +279,7 @@ SSL_CONN ssl_handshake_to_server(SOCKET s, char * hostname, SSL_CONFIG *config,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
do {
|
do {
|
||||||
struct pollfd fds[1] = {{}};
|
struct pollfd fds[1] = {{INVALID_SOCKET}};
|
||||||
int sslerr;
|
int sslerr;
|
||||||
|
|
||||||
err = SSL_connect(conn->ssl);
|
err = SSL_connect(conn->ssl);
|
||||||
@ -350,7 +350,7 @@ SSL_CONN ssl_handshake_to_client(SOCKET s, SSL_CONFIG *config, X509 *server_cert
|
|||||||
SSL_set_fd(conn->ssl, s);
|
SSL_set_fd(conn->ssl, s);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
struct pollfd fds[1] = {{}};
|
struct pollfd fds[1] = {{INVALID_SOCKET}};
|
||||||
int sslerr;
|
int sslerr;
|
||||||
|
|
||||||
err = SSL_accept(conn->ssl);
|
err = SSL_accept(conn->ssl);
|
||||||
|
|||||||
@ -116,11 +116,11 @@ void * threadfunc (void *p) {
|
|||||||
#undef param
|
#undef param
|
||||||
|
|
||||||
int pushthreadinit(){
|
int pushthreadinit(){
|
||||||
return
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WriteFile(conf.threadinit[1], "1", 1, NULL, NULL);
|
DWORD n;
|
||||||
|
return WriteFile(conf.threadinit[1], "1", 1, &n, NULL);
|
||||||
#else
|
#else
|
||||||
write(conf.threadinit[1], "1", 1);
|
return write(conf.threadinit[1], "1", 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user