Skip to content

Commit

Permalink
Close the connection after a fastcgi request. This lets web.go work w…
Browse files Browse the repository at this point in the history
…ith the nginx fastcgi module.
  • Loading branch information
hoisie committed Nov 21, 2010
1 parent 237b79a commit 2fa211e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fcgi.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ func (conn *fcgiConn) complete() {

conn.fd.Write(hdr.bytes())
conn.fd.Write(content)
conn.fd.Close()
}

func (conn *fcgiConn) Close() {}
Expand Down Expand Up @@ -266,7 +267,10 @@ func (s *Server) handleFcgiConnection(fd io.ReadWriteCloser) {
} else if h.ContentLength == 0 {
req = newRequestCgi(headers, &body)
s.routeHandler(req, fc)
//we close the connection after processing
//TODO: is there a way to keep it open for future requests?
fc.complete()
return
}
case fcgiData:
if h.ContentLength > 0 {
Expand Down

0 comments on commit 2fa211e

Please sign in to comment.