Fix for older Windows (7 and below) / VC

This commit is contained in:
Vladimir Dubrovin 2026-04-24 17:04:03 +03:00
parent e6c3427cab
commit 6b61cfde4c
4 changed files with 8 additions and 7 deletions

View File

@ -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(&param->sincr) == AF_INET

View File

@ -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");

View File

@ -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);

View File

@ -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
}