Skip to content

Commit 7d2a692

Browse files
committed
fb
1 parent 43a01f4 commit 7d2a692

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/SignalR/common/Http.Connections/ref/Microsoft.AspNetCore.Http.Connections.netcoreapp3.0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ public HttpConnectionContext(string id, System.IO.Pipelines.IDuplexPipe transpor
9898
public Microsoft.AspNetCore.Http.Connections.HttpTransportType TransportType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
9999
public System.Security.Claims.ClaimsPrincipal User { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
100100
public System.Threading.SemaphoreSlim WriteLock { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
101-
public bool ChangeState(Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionStatus from, Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionStatus to) { throw null; }
102101
[System.Diagnostics.DebuggerStepThroughAttribute]
103102
public System.Threading.Tasks.Task DisposeAsync(bool closeGracefully = false) { throw null; }
104103
public void OnHeartbeat(System.Action<object> action, object state) { }
105104
public void TickHeartbeat() { }
105+
public bool TryChangeState(Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionStatus from, Microsoft.AspNetCore.Http.Connections.Internal.HttpConnectionStatus to) { throw null; }
106106
}
107107
public partial class HttpConnectionDispatcher
108108
{

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ private async Task WaitOnTasks(Task applicationTask, Task transportTask, bool cl
310310
}
311311
}
312312

313-
public bool ChangeState(HttpConnectionStatus from, HttpConnectionStatus to)
313+
public bool TryChangeState(HttpConnectionStatus from, HttpConnectionStatus to)
314314
{
315315
return Interlocked.CompareExchange(ref _status, (int)to, (int)from) == (int)from;
316316
}

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connecti
235235
}
236236

237237
// Mark the connection as active
238-
connection.ChangeState(from: HttpConnectionStatus.Inactive, to: HttpConnectionStatus.Active);
238+
connection.TryChangeState(from: HttpConnectionStatus.Inactive, to: HttpConnectionStatus.Active);
239239

240240
// Raise OnConnected for new connections only since polls happen all the time
241241
if (connection.ApplicationTask == null)
@@ -333,7 +333,7 @@ private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connecti
333333

334334
// This is done outside a lock because the next poll might be waiting in the lock already and waiting for currentRequestTcs to complete
335335
// A DELETE request could have set the status to Disposed. If that is the case we don't want to change the state ever.
336-
connection.ChangeState(from: HttpConnectionStatus.Active, to: HttpConnectionStatus.Inactive);
336+
connection.TryChangeState(from: HttpConnectionStatus.Active, to: HttpConnectionStatus.Inactive);
337337
}
338338
}
339339
finally
@@ -373,7 +373,7 @@ private async Task DoPersistentConnection(ConnectionDelegate connectionDelegate,
373373
}
374374

375375
// Mark the connection as active
376-
connection.ChangeState(HttpConnectionStatus.Inactive, HttpConnectionStatus.Active);
376+
connection.TryChangeState(HttpConnectionStatus.Inactive, HttpConnectionStatus.Active);
377377

378378
// Call into the end point passing the connection
379379
connection.ApplicationTask = ExecuteApplication(connectionDelegate, connection);

0 commit comments

Comments
 (0)