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)))
|
||||
return res;
|
||||
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(*SAFAMILY(¶m->sincr) == AF_INET
|
||||
|
||||
@ -153,6 +153,7 @@ int start_proxy_thread(struct child * chp){
|
||||
pthread_t thread;
|
||||
#ifdef _WIN32
|
||||
HANDLE h;
|
||||
DWORD num;
|
||||
#endif
|
||||
char r[1];
|
||||
|
||||
@ -171,7 +172,7 @@ int start_proxy_thread(struct child * chp){
|
||||
pthread_attr_destroy(&pa);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
ReadFile(conf.threadinit[0], r, 1, NULL, NULL);
|
||||
ReadFile(conf.threadinit[0], r, 1, &num, NULL);
|
||||
#else
|
||||
while(read(conf.threadinit[0], r, 1) !=1) if(errno != EINTR) {
|
||||
fprintf(stderr, "pipe failed\n");
|
||||
|
||||
@ -279,7 +279,7 @@ SSL_CONN ssl_handshake_to_server(SOCKET s, char * hostname, SSL_CONFIG *config,
|
||||
#endif
|
||||
|
||||
do {
|
||||
struct pollfd fds[1] = {{}};
|
||||
struct pollfd fds[1] = {{INVALID_SOCKET}};
|
||||
int sslerr;
|
||||
|
||||
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);
|
||||
|
||||
do {
|
||||
struct pollfd fds[1] = {{}};
|
||||
struct pollfd fds[1] = {{INVALID_SOCKET}};
|
||||
int sslerr;
|
||||
|
||||
err = SSL_accept(conn->ssl);
|
||||
|
||||
@ -116,11 +116,11 @@ void * threadfunc (void *p) {
|
||||
#undef param
|
||||
|
||||
int pushthreadinit(){
|
||||
return
|
||||
#ifdef _WIN32
|
||||
WriteFile(conf.threadinit[1], "1", 1, NULL, NULL);
|
||||
DWORD n;
|
||||
return WriteFile(conf.threadinit[1], "1", 1, &n, NULL);
|
||||
#else
|
||||
write(conf.threadinit[1], "1", 1);
|
||||
return write(conf.threadinit[1], "1", 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user