diff options
author | Melanie | 2012-09-08 18:03:17 +0200 |
---|---|---|
committer | Melanie | 2012-09-08 18:03:17 +0200 |
commit | d734c1985cb442567437074e854ed77c3d9d61bc (patch) | |
tree | 9869d99b275f6d6ecf84d6191cc124a80ff4dbdc /OpenSim/Region/ClientStack | |
parent | Set the maximum number of concurrent connections to a service endpoint (diff) | |
parent | llClientView: try to have only one thread per client processing (diff) | |
download | opensim-SC-d734c1985cb442567437074e854ed77c3d9d61bc.zip opensim-SC-d734c1985cb442567437074e854ed77c3d9d61bc.tar.gz opensim-SC-d734c1985cb442567437074e854ed77c3d9d61bc.tar.bz2 opensim-SC-d734c1985cb442567437074e854ed77c3d9d61bc.tar.xz |
Merge branch 'ubitwork' into avination
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index e78ebed..7749ef3 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -8751,16 +8751,61 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8751 | 8751 | ||
8752 | #region Parcel related packets | 8752 | #region Parcel related packets |
8753 | 8753 | ||
8754 | // acumulate several HandleRegionHandleRequest consecutive overlaping requests | ||
8755 | // to be done with minimal resources as possible | ||
8756 | // variables temporary here while in test | ||
8757 | |||
8758 | Queue<UUID> RegionHandleRequests = new Queue<UUID>(); | ||
8759 | bool RegionHandleRequestsInService = false; | ||
8760 | |||
8754 | private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack) | 8761 | private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack) |
8755 | { | 8762 | { |
8756 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | 8763 | UUID currentUUID; |
8757 | 8764 | ||
8758 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; | 8765 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; |
8759 | if (handlerRegionHandleRequest != null) | 8766 | |
8767 | if (handlerRegionHandleRequest == null) | ||
8768 | return true; | ||
8769 | |||
8770 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | ||
8771 | |||
8772 | lock (RegionHandleRequests) | ||
8773 | { | ||
8774 | if (RegionHandleRequestsInService) | ||
8775 | { | ||
8776 | // we are already busy doing a previus request | ||
8777 | // so enqueue it | ||
8778 | RegionHandleRequests.Enqueue(rhrPack.RequestBlock.RegionID); | ||
8779 | return true; | ||
8780 | } | ||
8781 | |||
8782 | // else do it | ||
8783 | currentUUID = rhrPack.RequestBlock.RegionID; | ||
8784 | RegionHandleRequestsInService = true; | ||
8785 | } | ||
8786 | |||
8787 | while (true) | ||
8760 | { | 8788 | { |
8761 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | 8789 | handlerRegionHandleRequest(this, currentUUID); |
8790 | |||
8791 | lock (RegionHandleRequests) | ||
8792 | { | ||
8793 | // exit condition, nothing to do or closed | ||
8794 | // current code seems to assume we may loose the handler at anytime, | ||
8795 | // so keep checking it | ||
8796 | handlerRegionHandleRequest = OnRegionHandleRequest; | ||
8797 | |||
8798 | if (RegionHandleRequests.Count == 0 || !IsActive || handlerRegionHandleRequest == null) | ||
8799 | { | ||
8800 | RegionHandleRequests.Clear(); | ||
8801 | RegionHandleRequestsInService = false; | ||
8802 | return true; | ||
8803 | } | ||
8804 | currentUUID = RegionHandleRequests.Dequeue(); | ||
8805 | } | ||
8762 | } | 8806 | } |
8763 | return true; | 8807 | |
8808 | return true; // actually unreached | ||
8764 | } | 8809 | } |
8765 | 8810 | ||
8766 | private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack) | 8811 | private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack) |