Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 406e36a

Browse files
committed
Make reset conditional based on state.
1 parent b0b8df7 commit 406e36a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,12 @@ public bool HasResponseStarted
200200
get { return _responseStarted; }
201201
}
202202

203-
public void Reset()
203+
public bool Reset()
204204
{
205-
TransitionToState(FrameState.Waiting);
205+
if (TransitionToState(FrameState.Waiting) != FrameState.Waiting)
206+
{
207+
return false;
208+
}
206209

207210
_onStarting = null;
208211
_onCompleted = null;
@@ -251,6 +254,8 @@ public void Reset()
251254

252255
_manuallySetRequestAbortToken = null;
253256
_abortedCts = null;
257+
258+
return true;
254259
}
255260

256261
public void ResetResponseHeaders()

src/Microsoft.AspNet.Server.Kestrel/Http/FrameOfT.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ public override async Task RequestProcessingAsync()
135135
}
136136
}
137137

138-
Reset();
138+
if (!Reset())
139+
{
140+
return;
141+
}
139142
}
140143
}
141144
catch (Exception ex)

0 commit comments

Comments
 (0)