From 9c51f26d743ab405216a47a5f597564aed8da632 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Mon, 1 Jun 2020 21:27:15 +0200 Subject: [PATCH] Do not crash if os.Stat returns an error other than not found or no permission, which seems to mysteriously happen sometimes... --- handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handler.go b/handler.go index 9b98527..45ce873 100644 --- a/handler.go +++ b/handler.go @@ -94,6 +94,10 @@ func handleGeminiRequest(conn net.Conn, config Config, logEntries chan LogEntry) conn.Write([]byte("51 Not found!\r\n")) log.Status = 51 return + } else if err != nil { + conn.Write([]byte("40 Temporaray failure!\r\n")) + log.Status = 40 + return } // Handle URLS which map to a directory