llClientView: try to have only one thread per client processing
RegionHandleRequests. (code assumes packet handle is called async as it is not)avinationmerge
parent
71d2d327d0
commit
a91ca984d5
|
@ -8751,16 +8751,61 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
#region Parcel related packets
|
#region Parcel related packets
|
||||||
|
|
||||||
|
// acumulate several HandleRegionHandleRequest consecutive overlaping requests
|
||||||
|
// to be done with minimal resources as possible
|
||||||
|
// variables temporary here while in test
|
||||||
|
|
||||||
|
Queue<UUID> RegionHandleRequests = new Queue<UUID>();
|
||||||
|
bool RegionHandleRequestsInService = false;
|
||||||
|
|
||||||
private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack)
|
private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack)
|
||||||
{
|
{
|
||||||
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
UUID currentUUID;
|
||||||
|
|
||||||
RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
|
RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
|
||||||
if (handlerRegionHandleRequest != null)
|
|
||||||
|
if (handlerRegionHandleRequest == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
||||||
|
|
||||||
|
lock (RegionHandleRequests)
|
||||||
{
|
{
|
||||||
handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
|
if (RegionHandleRequestsInService)
|
||||||
|
{
|
||||||
|
// we are already busy doing a previus request
|
||||||
|
// so enqueue it
|
||||||
|
RegionHandleRequests.Enqueue(rhrPack.RequestBlock.RegionID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// else do it
|
||||||
|
currentUUID = rhrPack.RequestBlock.RegionID;
|
||||||
|
RegionHandleRequestsInService = true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
handlerRegionHandleRequest(this, currentUUID);
|
||||||
|
|
||||||
|
lock (RegionHandleRequests)
|
||||||
|
{
|
||||||
|
// exit condition, nothing to do or closed
|
||||||
|
// current code seems to assume we may loose the handler at anytime,
|
||||||
|
// so keep checking it
|
||||||
|
handlerRegionHandleRequest = OnRegionHandleRequest;
|
||||||
|
|
||||||
|
if (RegionHandleRequests.Count == 0 || !IsActive || handlerRegionHandleRequest == null)
|
||||||
|
{
|
||||||
|
RegionHandleRequests.Clear();
|
||||||
|
RegionHandleRequestsInService = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
currentUUID = RegionHandleRequests.Dequeue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true; // actually unreached
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack)
|
private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack)
|
||||||
|
|
Loading…
Reference in New Issue