Commit 6bd3f04
Check for sentinel value when setting HTTP/3 error code (#57934)
* Check for sentinel value when setting HTTP/3 error code
If no error code has been set, `IProtocolErrorFeature.Error` will be `-1`. If we pass that through verbatim, it will be caught by validation in the setter (ironically, of the same property on the same feature object), resulting in an exception and a Critical (but apparently benign) log message.
Fixes #57933
* Cover a couple other consumers of IProtocolErrorCodeFeature
* Add explanatory comment
Co-authored-by: James Newton-King <[email protected]>
* Use a property
* Add a regression test
---------
Co-authored-by: James Newton-King <[email protected]>1 parent d5d1960 commit 6bd3f04
File tree
3 files changed
+87
-4
lines changed- src/Servers/Kestrel
- Core/src/Internal/Http3
- test/InMemory.FunctionalTests/Http3
3 files changed
+87
-4
lines changedLines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
505 | 508 | | |
506 | 509 | | |
507 | 510 | | |
| 511 | + | |
| 512 | + | |
508 | 513 | | |
509 | 514 | | |
510 | 515 | | |
511 | 516 | | |
512 | 517 | | |
513 | | - | |
| 518 | + | |
514 | 519 | | |
515 | 520 | | |
516 | 521 | | |
| |||
546 | 551 | | |
547 | 552 | | |
548 | 553 | | |
549 | | - | |
| 554 | + | |
550 | 555 | | |
551 | 556 | | |
552 | 557 | | |
| |||
905 | 910 | | |
906 | 911 | | |
907 | 912 | | |
908 | | - | |
| 913 | + | |
909 | 914 | | |
910 | 915 | | |
911 | 916 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
704 | 782 | | |
705 | 783 | | |
706 | 784 | | |
| |||
0 commit comments