partage

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.z3bra.org/partage.git
Log | Files | Refs | README | LICENSE

commit 60f96bc6f2327274f7a8d4b9c792ef3d2ef74805
parent d33c6923d41cd16ef7ffd4549c727f1807349681
Author: Willy Goiffon <dev@z3bra.org>
Date:   Tue, 19 Oct 2021 20:11:22 +0200

Assume fastcgi when serving over Unix sockets

Diffstat:
Mpartage.go | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/partage.go b/partage.go @@ -10,6 +10,7 @@ import ( "log" "net" "net/http" + "net/http/fcgi" "os" "os/user" "path" @@ -357,5 +358,11 @@ func main() { log.Printf("Listening on %s", conf.bind) } - http.Serve(listener, nil) + if listener.Addr().Network() == "unix" { + err = fcgi.Serve(listener, nil) + log.Fatal(err) /* NOTREACHED */ + } + + err = http.Serve(listener, nil) + log.Fatal(err) /* NOTREACHED */ }