Callers must not use this method, but should instead use get(). Caller must hold c.mu.
()
| 429 | // |
| 430 | // Caller must hold c.mu. |
| 431 | func (c *controlBuffer) getOnceLocked() (any, error) { |
| 432 | if c.closed { |
| 433 | return false, ErrConnClosing |
| 434 | } |
| 435 | if c.list.isEmpty() { |
| 436 | return nil, nil |
| 437 | } |
| 438 | h := c.list.dequeue().(cbItem) |
| 439 | if h.isTransportResponseFrame() { |
| 440 | if c.transportResponseFrames == maxQueuedTransportResponseFrames { |
| 441 | // We are removing the frame that put us over the |
| 442 | // threshold; close and clear the throttling channel. |
| 443 | ch := c.trfChan.Swap(nil) |
| 444 | close(*ch) |
| 445 | } |
| 446 | c.transportResponseFrames-- |
| 447 | } |
| 448 | return h, nil |
| 449 | } |
| 450 | |
| 451 | // finish closes the control buffer, cleaning up any streams that have queued |
| 452 | // header frames. Once this method returns, no more frames can be added to the |
no test coverage detected