mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
some changes on oshttp send control
This commit is contained in:
@@ -163,31 +163,35 @@ namespace OSHttpServer
|
||||
curConcurrentLimit = inqueues;
|
||||
|
||||
HttpClientContext ctx;
|
||||
int sent;
|
||||
int sentFromQueue;
|
||||
bool done;
|
||||
while (curConcurrentLimit > 0)
|
||||
{
|
||||
sent = 0;
|
||||
sentFromQueue = 0;
|
||||
done = true;
|
||||
while (m_highPrio.TryDequeue(out ctx))
|
||||
{
|
||||
if (m_shuttingDown)
|
||||
return;
|
||||
done = false;
|
||||
if (ctx.TrySendResponse(curbytesLimit))
|
||||
{
|
||||
--curConcurrentLimit;
|
||||
if (++sent == 3)
|
||||
if (++sentFromQueue == 3)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sent = 0;
|
||||
sentFromQueue = 0;
|
||||
while(m_midPrio.TryDequeue(out ctx))
|
||||
{
|
||||
if (m_shuttingDown)
|
||||
return;
|
||||
done = false;
|
||||
if (ctx.TrySendResponse(curbytesLimit))
|
||||
{
|
||||
--curConcurrentLimit;
|
||||
if (++sent >= 2)
|
||||
if (++sentFromQueue >= 2)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -196,9 +200,13 @@ namespace OSHttpServer
|
||||
{
|
||||
if (m_shuttingDown)
|
||||
return;
|
||||
done = false;
|
||||
if (ctx.TrySendResponse(curbytesLimit))
|
||||
--curConcurrentLimit;
|
||||
}
|
||||
|
||||
if (done)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user