Commit b67a0f0
http2: send correct LastStreamID in stream-caused GOAWAY
When closing a connection because a stream contained a request we
didn't like (for example, because the request headers exceed
the maximum we will accept), set the LastStreamID in the GOAWAY
frame to include the offending stream. This informs the client
that retrying the request is unlikely to succeed, and avoids
retry loops.
This change requires passing the stream ID of the offending
stream from Framer.ReadFrame up to the caller. The most sensible
way to do this would probably be in the error. However,
ReadFrame currently returns a defined error type for
connection-ending errors (ConnectionError), and that type is a
uint32 with no place to put the stream ID. Rather than changing
the returned errors, ReadFrame now returns an error along with
a non-nil Frame containing the stream ID, when a stream is
responsible for a connection-ending error.
For golang/go#66668
Change-Id: Iba07ccbd70ab4939aa56903605474d01703ac6e4
Reviewed-on: https://go-review.googlesource.com/c/net/+/576756
Reviewed-by: Jonathan Amsterdam <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Damien Neil <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>1 parent a130fcc commit b67a0f0
3 files changed
+22
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
493 | 496 | | |
494 | 497 | | |
495 | 498 | | |
| |||
1521 | 1524 | | |
1522 | 1525 | | |
1523 | 1526 | | |
1524 | | - | |
| 1527 | + | |
1525 | 1528 | | |
1526 | 1529 | | |
1527 | 1530 | | |
| |||
1592 | 1595 | | |
1593 | 1596 | | |
1594 | 1597 | | |
1595 | | - | |
| 1598 | + | |
1596 | 1599 | | |
1597 | 1600 | | |
1598 | 1601 | | |
| |||
1604 | 1607 | | |
1605 | 1608 | | |
1606 | 1609 | | |
1607 | | - | |
| 1610 | + | |
1608 | 1611 | | |
1609 | 1612 | | |
1610 | 1613 | | |
1611 | | - | |
| 1614 | + | |
1612 | 1615 | | |
1613 | 1616 | | |
1614 | 1617 | | |
| |||
1625 | 1628 | | |
1626 | 1629 | | |
1627 | 1630 | | |
1628 | | - | |
| 1631 | + | |
1629 | 1632 | | |
1630 | 1633 | | |
1631 | 1634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1482 | 1482 | | |
1483 | 1483 | | |
1484 | 1484 | | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
1485 | 1490 | | |
1486 | 1491 | | |
1487 | 1492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4818 | 4818 | | |
4819 | 4819 | | |
4820 | 4820 | | |
4821 | | - | |
| 4821 | + | |
4822 | 4822 | | |
4823 | 4823 | | |
| 4824 | + | |
| 4825 | + | |
| 4826 | + | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
4824 | 4832 | | |
4825 | 4833 | | |
4826 | 4834 | | |
| |||
0 commit comments