Browse Source

close server down link

Darien Raymond 8 năm trước cách đây
mục cha
commit
7195c17af6
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      app/proxyman/mux/mux.go

+ 2 - 2
app/proxyman/mux/mux.go

@@ -321,11 +321,11 @@ func (w *ServerWorker) remove(id uint16) {
 
 func handle(ctx context.Context, s *session, output buf.Writer) {
 	writer := NewResponseWriter(s.id, output)
-	defer writer.Close()
-
 	if err := buf.PipeUntilEOF(signal.BackgroundTimer(), s.input, writer); err != nil {
 		log.Info("Proxyman|Mux|ServerWorker: Session ", s.id, " ends: ", err)
 	}
+	writer.Close()
+	s.closeDownlink()
 }
 
 func (w *ServerWorker) run(ctx context.Context) {