[Modify] Polish it
This commit is contained in:
parent
526fb635c9
commit
928fd0755f
@ -412,19 +412,18 @@ namespace WebSocketSharp.Net
|
||||
|
||||
private void cleanupContextQueue (bool sendServiceUnavailable)
|
||||
{
|
||||
HttpListenerContext[] ctxs = null;
|
||||
|
||||
lock (_contextQueueSync) {
|
||||
if (_contextQueue.Count == 0)
|
||||
return;
|
||||
|
||||
ctxs = _contextQueue.ToArray ();
|
||||
if (_contextQueue.Count == 0)
|
||||
return;
|
||||
|
||||
if (!sendServiceUnavailable) {
|
||||
_contextQueue.Clear ();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sendServiceUnavailable)
|
||||
return;
|
||||
var ctxs = _contextQueue.ToArray ();
|
||||
|
||||
_contextQueue.Clear ();
|
||||
|
||||
foreach (var ctx in ctxs) {
|
||||
ctx.ErrorStatusCode = 503;
|
||||
|
Loading…
Reference in New Issue
Block a user