This commit is contained in:
Pilzinsel64
2025-01-28 07:39:58 +01:00
parent 58794e5872
commit c7f343544d

View File

@@ -98,7 +98,7 @@ public class ApiServer(string apiUrl) : IApiServer
protected virtual void WaitForSlot() protected virtual void WaitForSlot()
{ {
if (MaxConcurentConnections == int.MaxValue) if (!AllowMultipleRequests)
return; // Unlimited in this case return; // Unlimited in this case
semaphore ??= new(MaxConcurentConnections, MaxConcurentConnections); semaphore ??= new(MaxConcurentConnections, MaxConcurentConnections);
semaphore.Wait(); semaphore.Wait();
@@ -257,8 +257,11 @@ public class ApiServer(string apiUrl) : IApiServer
// Listen for new request // Listen for new request
if (!AllowMultipleRequests) if (!AllowMultipleRequests)
{
FreeSlot();
Receive(); Receive();
} }
}
protected virtual void CheckContext(HttpListenerContext context) protected virtual void CheckContext(HttpListenerContext context)
{ {