From 59ea885da07c0916fb5917efb5538df2ecec1553 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Fri, 23 Apr 2021 20:16:50 +0900 Subject: Treat 127.0.0.1, [::1], and hostname as localhost --- local.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'local.c') diff --git a/local.c b/local.c index 56d589d..8cae710 100644 --- a/local.c +++ b/local.c @@ -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; } -- cgit v1.2.3