Treat 127.0.0.1, [::1], and hostname as localhost

This commit is contained in:
Tatsuya Kinoshita
2021-04-23 20:16:50 +09:00
parent 552dff061b
commit 59ea885da0
6 changed files with 38 additions and 38 deletions

View File

@@ -51,13 +51,10 @@ writeLocalCookie()
Str
localCookie()
{
char hostname[256];
if (Local_cookie)
return Local_cookie;
gethostname(hostname, 256);
srand48((long)New(char) + (long)time(NULL));
Local_cookie = Sprintf("%ld@%s", lrand48(), hostname);
Local_cookie = Sprintf("%ld@%s", lrand48(), HostName ? HostName : "localhost");
return Local_cookie;
}