Skip to content
Snippets Groups Projects
Commit 786add24 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Replace IPv6 colons in access-log filenames with exclaimation marks on Windows

Colons are not legal filename characters on Windows and when virtual hosts are
enabled, the IPv6 address of the server may be used in the access-log filename
so we need to clean that up or errors opening/creating the access-log files
occur.
parent 0210e38c
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4920 passed
......@@ -6960,8 +6960,14 @@ void http_logging_thread(void* arg)
}
SAFECOPY(newfilename,base);
if((startup->options&WEB_OPT_VIRTUAL_HOSTS) && ld->vhost!=NULL) {
SAFECAT(newfilename,ld->vhost);
if(ld->vhost[0])
char vhost[128];
SAFECOPY(vhost, ld->vhost);
#ifdef _WIN32
char* p;
REPLACE_CHARS(vhost, ':', '!', p);
#endif
SAFECAT(newfilename,vhost);
if(vhost[0])
SAFECAT(newfilename,"-");
}
strftime(strchr(newfilename,0),15,"%Y-%m-%d.log",&ld->completed);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment