commit 6c43650a2ca9263e514b7d5b383efd1fde36d759
parent ed8ed546fc59c825a7d435d0e9841664bdf32aa2
Author: Matsuda Kenji <info@mtkn.jp>
Date: Mon, 25 Dec 2023 12:58:45 +0900
delete rflush
Diffstat:
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git a/server.go b/server.go
@@ -351,9 +351,6 @@ func rAttach(ctx context.Context, c <-chan *Req) {
}
func sFlush(ctx context.Context, s *Server, c <-chan *Req) {
- rc := make(chan *Req)
- defer close(rc)
- go rFlush(ctx, rc)
for {
select {
case <-ctx.Done():
@@ -362,28 +359,11 @@ func sFlush(ctx context.Context, s *Server, c <-chan *Req) {
if !ok {
return
}
- rc <- r
- }
- }
-}
-
-func rFlush(ctx context.Context, c <-chan *Req) {
- for {
- select {
- case <-ctx.Done():
- return
- case r, ok := <-c:
- if !ok {
- return
- }
- if r.err != nil {
- panic(fmt.Errorf("err in flush: %v", r.err))
- }
if r.Oldreq != nil {
r.Oldreq.flush()
}
r.Ofcall = &RFlush{}
- r.Srv.respChan <- r
+ s.respChan <- r
}
}
}