Commit 812950b6 authored by Jens Bissinger's avatar Jens Bissinger

Allow to use fastcgi via standard io.

parent a760e46f
...@@ -55,6 +55,14 @@ func (app *App) Run() { ...@@ -55,6 +55,14 @@ func (app *App) Run() {
endRunning := make(chan bool, 1) endRunning := make(chan bool, 1)
if UseFcgi { if UseFcgi {
if UseStdIo {
err = fcgi.Serve(nil, app.Handlers) // standard I/O
if err == nil {
BeeLogger.Info("Use FCGI via standard I/O")
} else {
BeeLogger.Info("Cannot use FCGI via standard I/O", err)
}
} else {
if HttpPort == 0 { if HttpPort == 0 {
l, err = net.Listen("unix", addr) l, err = net.Listen("unix", addr)
} else { } else {
...@@ -64,6 +72,7 @@ func (app *App) Run() { ...@@ -64,6 +72,7 @@ func (app *App) Run() {
BeeLogger.Critical("Listen: ", err) BeeLogger.Critical("Listen: ", err)
} }
err = fcgi.Serve(l, app.Handlers) err = fcgi.Serve(l, app.Handlers)
}
} else { } else {
app.Server.Addr = addr app.Server.Addr = addr
app.Server.Handler = app.Handlers app.Server.Handler = app.Handlers
......
...@@ -61,6 +61,7 @@ var ( ...@@ -61,6 +61,7 @@ var (
SessionAutoSetCookie bool // auto setcookie SessionAutoSetCookie bool // auto setcookie
SessionDomain string // the cookie domain default is empty SessionDomain string // the cookie domain default is empty
UseFcgi bool UseFcgi bool
UseStdIo bool
MaxMemory int64 MaxMemory int64
EnableGzip bool // flag of enable gzip EnableGzip bool // flag of enable gzip
DirectoryIndex bool // flag of display directory index. default is false. DirectoryIndex bool // flag of display directory index. default is false.
...@@ -241,6 +242,7 @@ func init() { ...@@ -241,6 +242,7 @@ func init() {
SessionAutoSetCookie = true SessionAutoSetCookie = true
UseFcgi = false UseFcgi = false
UseStdIo = false
MaxMemory = 1 << 26 //64MB MaxMemory = 1 << 26 //64MB
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment