Commit 86145bbf authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Add Server.singleReader option which uses a single read loop.

parent 86baacc6
......@@ -43,6 +43,7 @@ type Server struct {
outstandingReadBufs int
kernelSettings InitIn
singleReader bool
canSplice bool
loops sync.WaitGroup
}
......@@ -239,7 +240,7 @@ func (ms *Server) readRequest(exitIdle bool) (req *request, code Status) {
dest = nil
}
ms.reqReaders--
if ms.reqReaders <= 0 {
if !ms.singleReader && ms.reqReaders <= 0 {
ms.loops.Add(1)
go ms.loop(true)
}
......@@ -311,8 +312,12 @@ exit:
break exit
}
if ms.singleReader {
go ms.handleRequest(req)
} else {
ms.handleRequest(req)
}
}
}
func (ms *Server) handleRequest(req *request) {
......
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