OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package fcgi | 5 package fcgi |
6 | 6 |
7 // This file implements FastCGI from the perspective of a child process. | 7 // This file implements FastCGI from the perspective of a child process. |
8 | 8 |
9 import ( | 9 import ( |
10 "fmt" | 10 "fmt" |
11 "http" | |
12 "http/cgi" | |
13 "io" | 11 "io" |
14 "net" | 12 "net" |
| 13 "net/http" |
| 14 "net/http/cgi" |
15 "os" | 15 "os" |
16 "time" | 16 "time" |
17 ) | 17 ) |
18 | 18 |
19 // request holds the state for an in-progress request. As soon as it's complete, | 19 // request holds the state for an in-progress request. As soon as it's complete, |
20 // it's converted to an http.Request. | 20 // it's converted to an http.Request. |
21 type request struct { | 21 type request struct { |
22 pw *io.PipeWriter | 22 pw *io.PipeWriter |
23 reqId uint16 | 23 reqId uint16 |
24 params map[string]string | 24 params map[string]string |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 for { | 249 for { |
250 rw, err := l.Accept() | 250 rw, err := l.Accept() |
251 if err != nil { | 251 if err != nil { |
252 return err | 252 return err |
253 } | 253 } |
254 c := newChild(rw, handler) | 254 c := newChild(rw, handler) |
255 go c.serve() | 255 go c.serve() |
256 } | 256 } |
257 panic("unreachable") | 257 panic("unreachable") |
258 } | 258 } |
OLD | NEW |