Fix FCGI (over TCP) support (#1368)

release/v1.15
Pavel Korovin 2017-03-23 10:57:43 +03:00 committed by Bo-Yi Wu
parent fe94032f74
commit ae9b02b079
1 changed files with 6 additions and 1 deletions

View File

@ -701,7 +701,12 @@ func runWeb(ctx *cli.Context) error {
case setting.HTTPS: case setting.HTTPS:
err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, context2.ClearHandler(m)) err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, context2.ClearHandler(m))
case setting.FCGI: case setting.FCGI:
err = fcgi.Serve(nil, context2.ClearHandler(m)) listener, err := net.Listen("tcp", listenAddr)
if err != nil {
log.Fatal(4, "Failed to bind %s", listenAddr, err)
}
defer listener.Close()
err = fcgi.Serve(listener, context2.ClearHandler(m))
case setting.UnixSocket: case setting.UnixSocket:
if err := os.Remove(listenAddr); err != nil && !os.IsNotExist(err) { if err := os.Remove(listenAddr); err != nil && !os.IsNotExist(err) {
log.Fatal(4, "Failed to remove unix socket directory %s: %v", listenAddr, err) log.Fatal(4, "Failed to remove unix socket directory %s: %v", listenAddr, err)