File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/Servers/Kestrel/Core/src/Internal/Http Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ internal sealed class HttpRequestPipeReader : PipeReader
17
17
{
18
18
private MessageBody _body ;
19
19
private HttpStreamState _state ;
20
- private Exception _error ;
20
+ private ExceptionDispatchInfo _error ;
21
21
22
22
public HttpRequestPipeReader ( )
23
23
{
@@ -92,7 +92,10 @@ public void Abort(Exception error = null)
92
92
if ( _state != HttpStreamState . Closed )
93
93
{
94
94
_state = HttpStreamState . Aborted ;
95
- _error = error ;
95
+ if ( error != null )
96
+ {
97
+ _error = ExceptionDispatchInfo . Capture ( error ) ;
98
+ }
96
99
}
97
100
}
98
101
@@ -112,7 +115,7 @@ private void ValidateState(CancellationToken cancellationToken = default)
112
115
{
113
116
if ( _error != null )
114
117
{
115
- ExceptionDispatchInfo . Capture ( _error ) . Throw ( ) ;
118
+ _error . Throw ( ) ;
116
119
}
117
120
else
118
121
{
You can’t perform that action at this time.
0 commit comments