Protect the responses map with a lock. Also remove ugly "this." type of
member notation.avinationmerge
parent
b8119ada59
commit
68ece236a6
|
@ -146,14 +146,14 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
|
||||||
HasEvents = (x, y) => { return this.responses.ContainsKey(x); };
|
HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); };
|
||||||
GetEvents = (x, y, s) =>
|
GetEvents = (x, y, s) =>
|
||||||
{
|
{
|
||||||
lock (responses)
|
lock (responses)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return this.responses[x];
|
return responses[x];
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -165,15 +165,15 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
Request = (x, y) =>
|
Request = (x, y) =>
|
||||||
{
|
{
|
||||||
y["RequestID"] = x.ToString();
|
y["RequestID"] = x.ToString();
|
||||||
lock (this.requests)
|
lock (requests)
|
||||||
this.requests.Add(y);
|
requests.Add(y);
|
||||||
|
|
||||||
m_queue.Enqueue(this);
|
m_queue.Enqueue(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
NoEvents = (x, y) =>
|
NoEvents = (x, y) =>
|
||||||
{
|
{
|
||||||
lock (this.requests)
|
lock (requests)
|
||||||
{
|
{
|
||||||
Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString());
|
Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString());
|
||||||
requests.Remove(request);
|
requests.Remove(request);
|
||||||
|
@ -198,7 +198,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (this.requests)
|
lock (requests)
|
||||||
{
|
{
|
||||||
request = requests[0];
|
request = requests[0];
|
||||||
requests.RemoveAt(0);
|
requests.RemoveAt(0);
|
||||||
|
@ -221,8 +221,10 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
response["content_type"] = "text/plain";
|
response["content_type"] = "text/plain";
|
||||||
response["keepalive"] = false;
|
response["keepalive"] = false;
|
||||||
response["reusecontext"] = false;
|
response["reusecontext"] = false;
|
||||||
|
|
||||||
lock (responses)
|
lock (responses)
|
||||||
responses[requestID] = response;
|
responses[requestID] = response;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,31 +144,34 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
public PollServiceInventoryEventArgs(UUID pId) :
|
public PollServiceInventoryEventArgs(UUID pId) :
|
||||||
base(null, null, null, null, pId, 30000)
|
base(null, null, null, null, pId, 30000)
|
||||||
{
|
{
|
||||||
HasEvents = (x, y) => { return this.responses.ContainsKey(x); };
|
HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); };
|
||||||
GetEvents = (x, y, s) =>
|
GetEvents = (x, y, s) =>
|
||||||
{
|
{
|
||||||
try
|
lock (responses)
|
||||||
{
|
{
|
||||||
return this.responses[x];
|
try
|
||||||
}
|
{
|
||||||
finally
|
return responses[x];
|
||||||
{
|
}
|
||||||
responses.Remove(x);
|
finally
|
||||||
|
{
|
||||||
|
responses.Remove(x);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Request = (x, y) =>
|
Request = (x, y) =>
|
||||||
{
|
{
|
||||||
y["RequestID"] = x.ToString();
|
y["RequestID"] = x.ToString();
|
||||||
lock (this.requests)
|
lock (requests)
|
||||||
this.requests.Add(y);
|
requests.Add(y);
|
||||||
|
|
||||||
m_queue.Enqueue(this);
|
m_queue.Enqueue(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
NoEvents = (x, y) =>
|
NoEvents = (x, y) =>
|
||||||
{
|
{
|
||||||
lock (this.requests)
|
lock (requests)
|
||||||
{
|
{
|
||||||
Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString());
|
Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString());
|
||||||
requests.Remove(request);
|
requests.Remove(request);
|
||||||
|
@ -192,7 +195,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (this.requests)
|
lock (requests)
|
||||||
{
|
{
|
||||||
request = requests[0];
|
request = requests[0];
|
||||||
requests.RemoveAt(0);
|
requests.RemoveAt(0);
|
||||||
|
@ -214,7 +217,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
response["str_response_string"] = m_webFetchHandler.FetchInventoryDescendentsRequest(request["body"].ToString(), String.Empty, String.Empty, null, null);
|
response["str_response_string"] = m_webFetchHandler.FetchInventoryDescendentsRequest(request["body"].ToString(), String.Empty, String.Empty, null, null);
|
||||||
|
|
||||||
responses[requestID] = response;
|
lock (responses)
|
||||||
|
responses[requestID] = response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue