Skip to content

Commit

Permalink
Fix FCGI (over TCP) support (#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkorovin authored and appleboy committed Mar 23, 2017
1 parent fe94032 commit ae9b02b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae9b02b

Please sign in to comment.