Fix FCGI (over TCP) support (#1368)
This commit is contained in:
parent
fe94032f74
commit
ae9b02b079
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue