commit 2c13f07672c329595634ef4ee1c96002a215978f
parent 211c6fb66bec57aad8db1e3b9cbbebeebed94c34
Author: Matsuda Kenji <info@mtkn.jp>
Date: Thu, 19 Oct 2023 19:51:29 +0900
add comment to getReq()
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/server.go b/server.go
@@ -104,6 +104,9 @@ func (s *Server) runSpeaker(w io.Writer) (chan<- *Req, <-chan error) {
return rc, ec
}
+// GetReq reads 9P message from r, allocates Req and returns it.
+// This function is called only by the server's listener goroutine,
+// and does not need to lock r.
func getReq(r io.Reader, s *Server) (*Req, error) {
buf, err := read9PMsg(r)
if err != nil {