(c *cleanupStream)
| 806 | } |
| 807 | |
| 808 | func (l *loopyWriter) cleanupStreamHandler(c *cleanupStream) error { |
| 809 | c.onWrite() |
| 810 | if str, ok := l.estdStreams[c.streamID]; ok { |
| 811 | // On the server side it could be a trailers-only response or |
| 812 | // a RST_STREAM before stream initialization thus the stream might |
| 813 | // not be established yet. |
| 814 | delete(l.estdStreams, c.streamID) |
| 815 | str.reader.Close() |
| 816 | str.deleteSelf() |
| 817 | for head := str.itl.dequeueAll(); head != nil; head = head.next { |
| 818 | if df, ok := head.it.(*dataFrame); ok { |
| 819 | if !df.processing { |
| 820 | df.data.Free() |
| 821 | } |
| 822 | } |
| 823 | } |
| 824 | } |
| 825 | if c.rst { // If RST_STREAM needs to be sent. |
| 826 | if err := l.framer.fr.WriteRSTStream(c.streamID, c.rstCode); err != nil { |
| 827 | return err |
| 828 | } |
| 829 | } |
| 830 | if l.draining && len(l.estdStreams) == 0 { |
| 831 | // Flush and close the connection; we are done with it. |
| 832 | return errors.New("finished processing active streams while in draining mode") |
| 833 | } |
| 834 | return nil |
| 835 | } |
| 836 | |
| 837 | func (l *loopyWriter) earlyAbortStreamHandler(eas *earlyAbortStream) error { |
| 838 | if l.side == clientSide { |
no test coverage detected