Thank you, RemedyTomm, for an update to your previous patch. Garbage-collect
the transfers that never happen.0.6.8-post-fixes
parent
7df54d4ad2
commit
1209db6dcd
|
@ -38,13 +38,18 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
public class XferModule : IRegionModule, IXfer
|
public class XferModule : IRegionModule, IXfer
|
||||||
{
|
{
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
|
private Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>();
|
||||||
|
private List<XferRequest> RequestTime = new List<XferRequest>();
|
||||||
public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
|
public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
|
||||||
public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
|
public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
|
||||||
public Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>();
|
|
||||||
|
|
||||||
public struct XferRequest
|
public struct XferRequest
|
||||||
{
|
{
|
||||||
public IClientAPI remoteClient;
|
public IClientAPI remoteClient;
|
||||||
public ulong xferID;
|
public ulong xferID;
|
||||||
|
public string fileName;
|
||||||
|
public DateTime timeStamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IRegionModule Members
|
#region IRegionModule Members
|
||||||
|
@ -138,13 +143,27 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (RequestTime.Count > 0)
|
||||||
|
{
|
||||||
|
TimeSpan ts = new TimeSpan(DateTime.UtcNow.Ticks - RequestTime[0].timeStamp.Ticks);
|
||||||
|
if (ts.TotalSeconds > 30)
|
||||||
|
{
|
||||||
|
Requests.Remove(RequestTime[0].fileName);
|
||||||
|
RequestTime.RemoveAt(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!Requests.ContainsKey(fileName))
|
if (!Requests.ContainsKey(fileName))
|
||||||
{
|
{
|
||||||
XferRequest nRequest = new XferRequest();
|
XferRequest nRequest = new XferRequest();
|
||||||
nRequest.remoteClient = remoteClient;
|
nRequest.remoteClient = remoteClient;
|
||||||
nRequest.xferID = xferID;
|
nRequest.xferID = xferID;
|
||||||
|
nRequest.fileName = fileName;
|
||||||
|
nRequest.timeStamp = DateTime.UtcNow;
|
||||||
Requests.Add(fileName, nRequest);
|
Requests.Add(fileName, nRequest);
|
||||||
|
RequestTime.Add(nRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue