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