identify contexts by ID now avaiable ( pipeline serialization)

httptests
UbitUmarov 2016-07-17 11:39:38 +01:00
parent c802368c86
commit 6a02ac634b
3 changed files with 9 additions and 4 deletions

View File

@ -47,8 +47,10 @@ namespace OpenSim.Framework.Servers.HttpServer
public readonly UUID RequestID; public readonly UUID RequestID;
public int contextHash; public int contextHash;
/*
private void GenContextHash() private void GenContextHash()
{ {
Random rnd = new Random(); Random rnd = new Random();
contextHash = 0; contextHash = 0;
if (Request.Headers["remote_addr"] != null) if (Request.Headers["remote_addr"] != null)
@ -62,8 +64,9 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
else else
contextHash += rnd.Next() & 0xffff; contextHash += rnd.Next() & 0xffff;
}
}
*/
public PollServiceHttpRequest( public PollServiceHttpRequest(
PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest)
{ {
@ -72,7 +75,8 @@ namespace OpenSim.Framework.Servers.HttpServer
Request = pRequest; Request = pRequest;
RequestTime = System.Environment.TickCount; RequestTime = System.Environment.TickCount;
RequestID = UUID.Random(); RequestID = UUID.Random();
GenContextHash(); // GenContextHash();
contextHash = HttpContext.contextID;
} }
internal void DoHTTPGruntWork(BaseHttpServer server, Hashtable responsedata) internal void DoHTTPGruntWork(BaseHttpServer server, Hashtable responsedata)
@ -132,8 +136,9 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
if (b1.contextHash != b2.contextHash) if (b1.contextHash != b2.contextHash)
return false; return false;
bool b = Object.ReferenceEquals(b1.HttpContext, b2.HttpContext); // bool b = Object.ReferenceEquals(b1.HttpContext, b2.HttpContext);
return b; // return b;
return true;
} }
public int GetHashCode(PollServiceHttpRequest b2) public int GetHashCode(PollServiceHttpRequest b2)

Binary file not shown.

Binary file not shown.