aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPavel Korovin <p@tristero.se>2017-03-23 10:57:43 +0300
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-03-23 15:57:43 +0800
commitae9b02b079954eabafc55ff1ab7527ba828f4bb6 (patch)
tree0bb3296fc6261f02c7506aff62def5e5481199c7 /cmd
parentfe94032f74298569512f6ece2fbe4f7ab9a24e46 (diff)
downloadgitea-ae9b02b079954eabafc55ff1ab7527ba828f4bb6.tar.gz
gitea-ae9b02b079954eabafc55ff1ab7527ba828f4bb6.zip
Fix FCGI (over TCP) support (#1368)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 5af9ad9f2d..3a20191bc5 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -701,7 +701,12 @@ func runWeb(ctx *cli.Context) error {
case setting.HTTPS:
err = runHTTPS(listenAddr, setting.CertFile, setting.KeyFile, context2.ClearHandler(m))
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:
if err := os.Remove(listenAddr); err != nil && !os.IsNotExist(err) {
log.Fatal(4, "Failed to remove unix socket directory %s: %v", listenAddr, err)