diff options
Diffstat (limited to 'src/go/unit/port.go')
-rw-r--r-- | src/go/unit/port.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/go/unit/port.go b/src/go/unit/port.go index 6eaa86bb..2dc273fd 100644 --- a/src/go/unit/port.go +++ b/src/go/unit/port.go @@ -206,6 +206,14 @@ func (p *port) read(handler http.Handler) error { r := find_request(c_req) + if len(r.msgs) == 0 { + r.push(m) + } else if r.ch != nil { + r.ch <- m + } else { + m.Close() + } + go func(r *request) { if handler == nil { handler = http.DefaultServeMux @@ -215,13 +223,5 @@ func (p *port) read(handler http.Handler) error { r.done() }(r) - if len(r.msgs) == 0 { - r.push(m) - } else if r.ch != nil { - r.ch <- m - } else { - m.Close() - } - return nil } |