seems to compile ( tests comented out)

This commit is contained in:
UbitUmarov
2015-09-02 19:54:53 +01:00
parent 371c9dd2af
commit a11edceb00
157 changed files with 1315 additions and 9792 deletions

View File

@@ -150,12 +150,8 @@ namespace OpenSim.Framework
Type == (sbyte)AssetType.Folder ||
Type == (sbyte)AssetType.ImageJPEG ||
Type == (sbyte)AssetType.ImageTGA ||
<<<<<<< HEAD
Type == (sbyte)AssetType.LSLBytecode);
=======
Type == (sbyte)AssetType.Mesh ||
Type == (sbyte) AssetType.LSLBytecode);
>>>>>>> avn/ubitvar
}
}

View File

@@ -395,26 +395,7 @@ namespace OpenSim.Framework.Communications
return null;
}
<<<<<<< HEAD
=======
using (Stream src = _response.GetResponseStream())
{
int length = src.Read(_readbuf, 0, BufferSize);
while (length > 0)
{
_resource.Write(_readbuf, 0, length);
length = src.Read(_readbuf, 0, BufferSize);
}
}
// TODO! Implement timeout, without killing the server
// this line implements the timeout, if there is a timeout, the callback fires and the request becomes aborted
//ThreadPool.RegisterWaitForSingleObject(responseAsyncResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true);
// _allDone.WaitOne();
if (_response != null)
_response.Close();
>>>>>>> avn/ubitvar
if (_asyncException != null)
throw _asyncException;
@@ -444,7 +425,6 @@ namespace OpenSim.Framework.Communications
auth.AddAuthorization(_request.Headers);
src.Seek(0, SeekOrigin.Begin);
<<<<<<< HEAD
int reqnum = WebUtil.RequestNumber++;
if (WebUtil.DebugLevel >= 3)
@@ -452,16 +432,7 @@ namespace OpenSim.Framework.Communications
if (WebUtil.DebugLevel >= 5)
WebUtil.LogOutgoingDetail(string.Format("SEND {0}: ", reqnum), src);
Stream dst = _request.GetRequestStream();
byte[] buf = new byte[1024];
int length = src.Read(buf, 0, 1024);
while (length > 0)
=======
m_log.Info("[REST]: Seek is ok");
using (Stream dst = _request.GetRequestStream())
>>>>>>> avn/ubitvar
{
m_log.Info("[REST]: GetRequestStream is ok");

View File

@@ -363,30 +363,43 @@ namespace OpenSim.Framework
return false;
}
public bool IsBanned(UUID avatarID)
{
if (!IsEstateManagerOrOwner(avatarID))
{
foreach (EstateBan ban in l_EstateBans)
if (ban.BannedUserID == avatarID)
return true;
}
return false;
}
public bool IsBanned(UUID avatarID, int userFlags)
{
foreach (EstateBan ban in l_EstateBans)
if (!IsEstateManagerOrOwner(avatarID))
{
foreach (EstateBan ban in l_EstateBans)
if (ban.BannedUserID == avatarID)
return true;
if (!IsEstateManagerOrOwner(avatarID) && !HasAccess(avatarID))
{
if (DenyMinors)
if (!HasAccess(avatarID))
{
if ((userFlags & 32) == 0)
if (DenyMinors)
{
return true;
if ((userFlags & 32) == 0)
{
return true;
}
}
}
if (DenyAnonymous)
{
if ((userFlags & 4) == 0)
if (DenyAnonymous)
{
return true;
if ((userFlags & 4) == 0)
{
return true;
}
}
}
}
return false;
}

View File

@@ -65,20 +65,15 @@ namespace OpenSim.Framework
/// </remarks>
AvatarAppearance Appearance { get; set; }
/// <summary>
/// Set if initial data about the scene (avatars, objects) has been sent to the client.
/// </summary>
bool SentInitialDataToClient { get; }
/// <summary>
/// Send initial scene data to the client controlling this agent
/// </summary>
/// <remarks>
/// This includes scene object data and the appearance data of other avatars.
/// </remarks>
void SendInitialDataToClient();
void SendInitialDataToMe();
/// <summary>
/// <summary>
/// Direction in which the scene presence is looking.
/// </summary>
/// <remarks>Will be Vector3.Zero for a child agent.</remarks>

View File

@@ -245,15 +245,6 @@ namespace OpenSim.Framework
// occasionally seems to corrupt its addin cache
// Hence, as a temporary solution we'll remove it before each startup
<<<<<<< HEAD
try
{
if (Directory.Exists(dir + "/addin-db-000"))
Directory.Delete(dir + "/addin-db-000", true);
if (Directory.Exists(dir + "/addin-db-001"))
Directory.Delete(dir + "/addin-db-001", true);
=======
string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY");
string v0 = "addin-db-000";
string v1 = "addin-db-001";
@@ -269,7 +260,7 @@ namespace OpenSim.Framework
if (Directory.Exists(v1))
Directory.Delete(v1, true);
>>>>>>> avn/ubitvar
}
catch (IOException)
{

View File

@@ -102,12 +102,11 @@ namespace OpenSim.Framework
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly string LogHeader = "[REGION INFO]";
<<<<<<< HEAD
=======
public bool commFailTF = false;
public ConfigurationMember configMember;
public string DataStore = String.Empty;
>>>>>>> avn/ubitvar
public string RegionFile = String.Empty;
public bool isSandbox = false;
public bool Persistent = true;
@@ -534,11 +533,7 @@ namespace OpenSim.Framework
return null;
}
<<<<<<< HEAD
private void SetExtraSetting(string key, string value)
=======
public void SetExtraSetting(string key, string value)
>>>>>>> avn/ubitvar
{
string keylower = key.ToLower();
m_extraSettings[keylower] = value;
@@ -834,22 +829,16 @@ namespace OpenSim.Framework
string location = String.Format("{0},{1}", RegionLocX, RegionLocY);
config.Set("Location", location);
<<<<<<< HEAD
if (RegionSizeX > 0)
=======
if (DataStore != String.Empty)
config.Set("Datastore", DataStore);
if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize)
{
>>>>>>> avn/ubitvar
config.Set("SizeX", RegionSizeX);
if (RegionSizeY > 0)
config.Set("SizeY", RegionSizeY);
// if (RegionSizeZ > 0)
// config.Set("SizeZ", RegionSizeZ);
// if (RegionSizeZ > 0)
// config.Set("SizeZ", RegionSizeZ);
}
config.Set("InternalAddress", m_internalEndPoint.Address.ToString());
config.Set("InternalPort", m_internalEndPoint.Port);
@@ -920,8 +909,6 @@ namespace OpenSim.Framework
throw new Exception("Invalid file type for region persistence.");
}
<<<<<<< HEAD
=======
public void loadConfigurationOptionsFromMe()
{
configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE,
@@ -984,7 +971,7 @@ namespace OpenSim.Framework
"Max prims an object will hold", m_linksetCapacity.ToString(), true);
configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Max avatars this sim will hold", m_agentCapacity.ToString(), true);
"Max avatars this sim will hold",AgentCapacity.ToString(), true);
configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID,
"Scope ID for this region", ScopeID.ToString(), true);
@@ -1131,7 +1118,7 @@ namespace OpenSim.Framework
m_linksetCapacity = (int)configuration_result;
break;
case "agent_capacity":
m_agentCapacity = (int)configuration_result;
AgentCapacity = (int)configuration_result;
break;
case "scope_id":
ScopeID = (UUID)configuration_result;
@@ -1147,7 +1134,7 @@ namespace OpenSim.Framework
return true;
}
>>>>>>> avn/ubitvar
public void SaveLastMapUUID(UUID mapUUID)
{
lastMapUUID = mapUUID;

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Framework.RegionLoader.Web
}
else
{
IConfig startupConfig = (IConfig) m_configSource.Configs["Startup"];
IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"];
string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim();
bool allowRegionless = startupConfig.GetBoolean("allow_regionless", false);
@@ -69,101 +69,74 @@ namespace OpenSim.Framework.RegionLoader.Web
}
else
{
while(tries > 0)
{
RegionInfo[] regionInfos = new RegionInfo[] {};
int regionCount = 0;
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
webRequest.Timeout = 30000; //30 Second Timeout
m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
while (tries > 0)
{
RegionInfo[] regionInfos = new RegionInfo[] { };
int regionCount = 0;
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Timeout = 30000; //30 Second Timeout
m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
try
{
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
m_log.Debug("[WEBLOADER]: Downloading region information...");
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string xmlSource = String.Empty;
string tempStr = reader.ReadLine();
while (tempStr != null)
{
xmlSource = xmlSource + tempStr;
tempStr = reader.ReadLine();
}
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
xmlSource.Length);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlSource);
if (xmlDoc.FirstChild.Name == "Nini")
{
regionCount = xmlDoc.FirstChild.ChildNodes.Count;
if (regionCount > 0)
{
regionInfos = new RegionInfo[regionCount];
int i;
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
{
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
regionInfos[i] =
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
}
}
}
}
catch (WebException ex)
{
if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound)
{
if (!allowRegionless)
throw ex;
}
else
throw ex;
}
<<<<<<< HEAD
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
xmlSource.Length);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlSource);
if (xmlDoc.FirstChild.Name == "Nini")
try
{
regionCount = xmlDoc.FirstChild.ChildNodes.Count;
if (regionCount > 0)
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
m_log.Debug("[WEBLOADER]: Downloading region information...");
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string xmlSource = String.Empty;
string tempStr = reader.ReadLine();
while (tempStr != null)
{
regionInfos = new RegionInfo[regionCount];
int i;
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
xmlSource = xmlSource + tempStr;
tempStr = reader.ReadLine();
}
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
xmlSource.Length);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlSource);
if (xmlDoc.FirstChild.Name == "Nini")
{
regionCount = xmlDoc.FirstChild.ChildNodes.Count;
if (regionCount > 0)
{
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
regionInfos[i] =
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
regionInfos = new RegionInfo[regionCount];
int i;
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
{
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
regionInfos[i] =
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i], false, m_configSource);
}
}
}
}
}
catch (WebException ex)
{
using (HttpWebResponse response = (HttpWebResponse)ex.Response)
=======
if (regionCount > 0 | allowRegionless)
return regionInfos;
catch (WebException ex)
{
if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound)
{
if (!allowRegionless)
throw ex;
}
else
throw ex;
}
if (regionCount > 0 | allowRegionless)
return regionInfos;
m_log.Debug("[WEBLOADER]: Request yielded no regions.");
tries--;
if (tries > 0)
>>>>>>> avn/ubitvar
{
m_log.Debug("[WEBLOADER]: Retrying");
System.Threading.Thread.Sleep(wait);
}
}
}
m_log.Error("[WEBLOADER]: No region configs were available.");
return null;
m_log.Error("[WEBLOADER]: No region configs were available.");
return null;
}
}
}
}
}
}

View File

@@ -65,12 +65,9 @@ namespace OpenSim.Framework.Servers
/// This will control a periodic log printout of the current 'show stats' (if they are active) for this
/// server.
/// </summary>
<<<<<<< HEAD
private int m_periodDiagnosticTimerMS = 60 * 60 * 1000;
private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000);
=======
// private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000);
>>>>>>> avn/ubitvar
/// <summary>
/// Random uuid for private data
@@ -88,11 +85,8 @@ namespace OpenSim.Framework.Servers
// Random uuid for private data
m_osSecret = UUID.Random().ToString();
<<<<<<< HEAD
=======
// m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
// m_periodicDiagnosticsTimer.Enabled = true;
>>>>>>> avn/ubitvar
m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
m_periodicDiagnosticsTimer.Enabled = true;
}
/// <summary>

View File

@@ -1947,14 +1947,10 @@ namespace OpenSim.Framework.Servers.HttpServer
m_httpListener2.Start(64);
// Long Poll Service Manager with 3 worker threads a 25 second timeout for no events
<<<<<<< HEAD
PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 3, 25000);
PollServiceRequestManager.Start();
=======
m_PollServiceManager = new PollServiceRequestManager(this, 4, 25000);
m_PollServiceManager.Start();
>>>>>>> avn/ubitvar
HTTPDRunning = true;
//HttpListenerContext context;

View File

@@ -74,16 +74,11 @@ namespace OpenSim.Framework.Servers.HttpServer
private Thread[] m_workerThreads;
private Thread m_retrysThread;
<<<<<<< HEAD
private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2);
// private int m_timeout = 1000; // increase timeout 250; now use the event one
=======
private bool m_running = true;
private int slowCount = 0;
private SmartThreadPool m_threadPool;
>>>>>>> avn/ubitvar
public PollServiceRequestManager(
BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout)
@@ -93,7 +88,7 @@ namespace OpenSim.Framework.Servers.HttpServer
m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount];
<<<<<<< HEAD
/*
StatsManager.RegisterStat(
new Stat(
"QueuedPollResponses",
@@ -119,7 +114,7 @@ namespace OpenSim.Framework.Servers.HttpServer
MeasuresOfInterest.AverageChangeOverTime,
stat => stat.Value = ResponsesProcessed,
StatVerbosity.Debug));
=======
*/
PollServiceHttpRequestComparer preqCp = new PollServiceHttpRequestComparer();
m_bycontext = new Dictionary<PollServiceHttpRequest, Queue<PollServiceHttpRequest>>(preqCp);
@@ -132,46 +127,16 @@ namespace OpenSim.Framework.Servers.HttpServer
startInfo.ThreadPoolName = "PoolService";
m_threadPool = new SmartThreadPool(startInfo);
>>>>>>> avn/ubitvar
}
public void Start()
{
<<<<<<< HEAD
IsRunning = true;
if (PerformResponsesAsync)
{
//startup worker threads
for (uint i = 0; i < m_WorkerThreadCount; i++)
{
m_workerThreads[i]
= WorkManager.StartThread(
PoolWorkerJob,
string.Format("PollServiceWorkerThread{0}:{1}", i, m_server.Port),
ThreadPriority.Normal,
false,
false,
null,
int.MaxValue);
}
WorkManager.StartThread(
this.CheckLongPollThreads,
string.Format("LongPollServiceWatcherThread:{0}", m_server.Port),
ThreadPriority.Normal,
false,
true,
null,
1000 * 60 * 10);
}
=======
m_threadPool.Start();
//startup worker threads
for (uint i = 0; i < m_WorkerThreadCount; i++)
{
m_workerThreads[i]
= Watchdog.StartThread(
= WorkManager.StartThread(
PoolWorkerJob,
string.Format("PollServiceWorkerThread {0}:{1}", i, m_server.Port),
ThreadPriority.Normal,
@@ -181,7 +146,7 @@ namespace OpenSim.Framework.Servers.HttpServer
int.MaxValue);
}
m_retrysThread = Watchdog.StartThread(
m_retrysThread = WorkManager.StartThread(
this.CheckRetries,
string.Format("PollServiceWatcherThread:{0}", m_server.Port),
ThreadPriority.Normal,
@@ -189,7 +154,7 @@ namespace OpenSim.Framework.Servers.HttpServer
true,
null,
1000 * 60 * 10);
>>>>>>> avn/ubitvar
}
private void ReQueueEvent(PollServiceHttpRequest req)
@@ -258,36 +223,13 @@ namespace OpenSim.Framework.Servers.HttpServer
private void CheckRetries()
{
<<<<<<< HEAD
// The only purpose of this thread is to check the EQs for events.
// If there are events, that thread will be placed in the "ready-to-serve" queue, m_requests.
// If there are no events, that thread will be back to its "waiting" queue, m_longPollRequests.
// All other types of tasks (Inventory handlers, http-in, etc) don't have the long-poll nature,
// so if they aren't ready to be served by a worker thread (no events), they are placed
// directly back in the "ready-to-serve" queue by the worker thread.
while (IsRunning)
=======
while (m_running)
>>>>>>> avn/ubitvar
{
Thread.Sleep(100); // let the world move .. back to faster rate
Watchdog.UpdateThread();
lock (m_retryRequests)
{
<<<<<<< HEAD
if (m_longPollRequests.Count > 0 && IsRunning)
{
List<PollServiceHttpRequest> ready = m_longPollRequests.FindAll(req =>
(req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ
(Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) // no events, but timeout
);
ready.ForEach(req =>
{
m_requests.Enqueue(req);
m_longPollRequests.Remove(req);
});
=======
while (m_retryRequests.Count > 0 && m_running)
m_requests.Enqueue(m_retryRequests.Dequeue());
}
@@ -295,7 +237,6 @@ namespace OpenSim.Framework.Servers.HttpServer
if (slowCount >= 10)
{
slowCount = 0;
>>>>>>> avn/ubitvar
lock (m_slowRequests)
{
@@ -308,12 +249,8 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Stop()
{
<<<<<<< HEAD
IsRunning = false;
// m_timeout = -10000; // cause all to expire
=======
m_running = false;
>>>>>>> avn/ubitvar
Thread.Sleep(1000); // let the world move
foreach (Thread t in m_workerThreads)
@@ -341,13 +278,9 @@ namespace OpenSim.Framework.Servers.HttpServer
lock (m_slowRequests)
{
<<<<<<< HEAD
if (m_longPollRequests.Count > 0 && IsRunning)
m_longPollRequests.ForEach(req => m_requests.Enqueue(req));
=======
while (m_slowRequests.Count > 0)
m_requests.Enqueue(m_slowRequests.Dequeue());
>>>>>>> avn/ubitvar
}
while (m_requests.Count() > 0)
@@ -355,13 +288,8 @@ namespace OpenSim.Framework.Servers.HttpServer
try
{
wreq = m_requests.Dequeue(0);
<<<<<<< HEAD
ResponsesProcessed++;
wreq.DoHTTPGruntWork(
m_server, wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id));
=======
wreq.DoHTTPstop(m_server);
>>>>>>> avn/ubitvar
}
catch
{
@@ -375,91 +303,35 @@ namespace OpenSim.Framework.Servers.HttpServer
private void PoolWorkerJob()
{
while (IsRunning)
while (m_running)
{
<<<<<<< HEAD
=======
PollServiceHttpRequest req = m_requests.Dequeue(5000);
>>>>>>> avn/ubitvar
Watchdog.UpdateThread();
WaitPerformResponse();
}
}
public void WaitPerformResponse()
{
PollServiceHttpRequest req = m_requests.Dequeue(5000);
// m_log.DebugFormat("[YYY]: Dequeued {0}", (req == null ? "null" : req.PollServiceArgs.Type.ToString()));
if (req != null)
{
try
if (req != null)
{
if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
try
{
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id);
<<<<<<< HEAD
if (responsedata == null)
return;
// This is the event queue.
// Even if we're not running we can still perform responses by explicit request.
if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll
|| !PerformResponsesAsync)
if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
{
try
{
ResponsesProcessed++;
req.DoHTTPGruntWork(m_server, responsedata);
}
catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream
{
// Ignore it, no need to reply
m_log.Error(e);
}
}
else
{
m_threadPool.QueueWorkItem(x =>
=======
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id);
if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) // This is the event queue
>>>>>>> avn/ubitvar
{
try
{
ResponsesProcessed++;
req.DoHTTPGruntWork(m_server, responsedata);
byContextDequeue(req);
}
catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream
catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
{
// Ignore it, no need to reply
m_log.Error(e);
}
catch (Exception e)
}
else
{
m_threadPool.QueueWorkItem(x =>
{
<<<<<<< HEAD
m_log.Error(e);
}
return null;
}, null);
}
}
else
{
if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
{
ResponsesProcessed++;
req.DoHTTPGruntWork(
m_server, req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
}
else
{
ReQueueEvent(req);
=======
try
{
req.DoHTTPGruntWork(m_server, responsedata);
@@ -478,7 +350,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
{
req.DoHTTPGruntWork(m_server,
req.DoHTTPGruntWork(m_server,
req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
byContextDequeue(req);
}
@@ -486,17 +358,15 @@ namespace OpenSim.Framework.Servers.HttpServer
{
ReQueueEvent(req);
}
>>>>>>> avn/ubitvar
}
}
}
catch (Exception e)
{
m_log.ErrorFormat("Exception in poll service thread: " + e.ToString());
catch (Exception e)
{
m_log.ErrorFormat("Exception in poll service thread: " + e.ToString());
}
}
}
}
}
}

View File

@@ -41,9 +41,6 @@ namespace OpenSim.Framework.Servers.Tests
{
[TestFixture]
public class OSHttpTests : OpenSimTestCase
<<<<<<< HEAD
{
=======
{
// we need an IHttpClientContext for our tests
public class TestHttpClientContext: IHttpClientContext
@@ -363,9 +360,8 @@ namespace OpenSim.Framework.Servers.Tests
public void Redirect(Uri uri) {}
public void Redirect(string url) {}
}
>>>>>>> avn/ubitvar
public OSHttpRequest req0;
public OSHttpRequest req1;

View File

@@ -160,11 +160,7 @@ namespace OpenSim.Framework
public virtual ulong HomeRegion
{
get
<<<<<<< HEAD
{
=======
{
>>>>>>> avn/ubitvar
return Util.RegionWorldLocToHandle(Util.RegionToWorldLoc(m_homeRegionX), Util.RegionToWorldLoc(m_homeRegionY));
// return Utils.UIntsToLong( m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize);
}

View File

@@ -91,6 +91,14 @@ namespace OpenSim.Framework
public UUID TargetId;
public string Notes;
}
public class UserPreferences
{
public UUID UserId;
public bool IMViaEmail = false;
public bool Visible = false;
public string EMail = string.Empty;
}
public class UserAccountProperties
{

View File

@@ -1688,69 +1688,6 @@ namespace OpenSim.Framework
return displayConnectionString;
}
public static T ReadSettingsFromIniFile<T>(IConfig config, T settingsClass)
{
Type settingsType = settingsClass.GetType();
FieldInfo[] fieldInfos = settingsType.GetFields();
foreach (FieldInfo fieldInfo in fieldInfos)
{
if (!fieldInfo.IsStatic)
{
if (fieldInfo.FieldType == typeof(System.String))
{
fieldInfo.SetValue(settingsClass, config.Get(fieldInfo.Name, (string)fieldInfo.GetValue(settingsClass)));
}
else if (fieldInfo.FieldType == typeof(System.Boolean))
{
fieldInfo.SetValue(settingsClass, config.GetBoolean(fieldInfo.Name, (bool)fieldInfo.GetValue(settingsClass)));
}
else if (fieldInfo.FieldType == typeof(System.Int32))
{
fieldInfo.SetValue(settingsClass, config.GetInt(fieldInfo.Name, (int)fieldInfo.GetValue(settingsClass)));
}
else if (fieldInfo.FieldType == typeof(System.Single))
{
fieldInfo.SetValue(settingsClass, config.GetFloat(fieldInfo.Name, (float)fieldInfo.GetValue(settingsClass)));
}
else if (fieldInfo.FieldType == typeof(System.UInt32))
{
fieldInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(fieldInfo.Name, ((uint)fieldInfo.GetValue(settingsClass)).ToString())));
}
}
}
PropertyInfo[] propertyInfos = settingsType.GetProperties();
foreach (PropertyInfo propInfo in propertyInfos)
{
if ((propInfo.CanRead) && (propInfo.CanWrite))
{
if (propInfo.PropertyType == typeof(System.String))
{
propInfo.SetValue(settingsClass, config.Get(propInfo.Name, (string)propInfo.GetValue(settingsClass, null)), null);
}
else if (propInfo.PropertyType == typeof(System.Boolean))
{
propInfo.SetValue(settingsClass, config.GetBoolean(propInfo.Name, (bool)propInfo.GetValue(settingsClass, null)), null);
}
else if (propInfo.PropertyType == typeof(System.Int32))
{
propInfo.SetValue(settingsClass, config.GetInt(propInfo.Name, (int)propInfo.GetValue(settingsClass, null)), null);
}
else if (propInfo.PropertyType == typeof(System.Single))
{
propInfo.SetValue(settingsClass, config.GetFloat(propInfo.Name, (float)propInfo.GetValue(settingsClass, null)), null);
}
if (propInfo.PropertyType == typeof(System.UInt32))
{
propInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(propInfo.Name, ((uint)propInfo.GetValue(settingsClass, null)).ToString())), null);
}
}
}
return settingsClass;
}
public static string Base64ToString(string str)
{
Decoder utf8Decode = Encoding.UTF8.GetDecoder();
@@ -2156,11 +2093,6 @@ namespace OpenSim.Framework
}
}
public static void FireAndForget(System.Threading.WaitCallback callback)
{
FireAndForget(callback, null);
}
public static void InitThreadPool(int minThreads, int maxThreads)
{
if (maxThreads < 2)

View File

@@ -29,11 +29,7 @@ namespace OpenSim
{
public class VersionInfo
{
<<<<<<< HEAD:OpenSim/Framework/VersionInfo.cs
public const string VersionNumber = "0.8.2.0";
=======
private const string VERSION_NUMBER = "0.8.0CM";
>>>>>>> avn/ubitvar:OpenSim/Framework/Servers/VersionInfo.cs
public const string VersionNumber = "0.8.2.0CM";
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour

View File

@@ -205,16 +205,8 @@ namespace OpenSim.Framework
{
if (DebugLevel == 5)
{
<<<<<<< HEAD
if (output.Length > MaxRequestDiagLength)
output = output.Substring(0, MaxRequestDiagLength) + "...";
=======
int len = output.Length;
if(len > 80)
len = 80;
output = output.Substring(0, len);
output = output + "...";
>>>>>>> avn/ubitvar
}
m_log.DebugFormat("[LOGHTTP]: {0}{1}", context, Util.BinaryToASCII(output));
@@ -295,12 +287,9 @@ namespace OpenSim.Framework
}
else
{
<<<<<<< HEAD
=======
tickcompressdata = tickJsondata;
compsize = buffer.Length;
request.ContentType = "application/json";
>>>>>>> avn/ubitvar
request.ContentLength = buffer.Length; //Count bytes to send
using (Stream requestStream = request.GetRequestStream())
requestStream.Write(buffer, 0, buffer.Length); //Send it
@@ -315,7 +304,6 @@ namespace OpenSim.Framework
{
using (Stream responseStream = response.GetResponseStream())
{
<<<<<<< HEAD
using (StreamReader reader = new StreamReader(responseStream))
{
string responseStr = reader.ReadToEnd();
@@ -323,12 +311,6 @@ namespace OpenSim.Framework
WebUtil.LogResponseDetail(reqnum, responseStr);
return CanonicalizeResults(responseStr);
}
=======
string responseStr = null;
responseStr = responseStream.GetStreamString();
//m_log.DebugFormat("[WEB UTIL]: <{0}> response is <{1}>",reqnum,responseStr);
return CanonicalizeResults(responseStr);
>>>>>>> avn/ubitvar
}
}
}
@@ -352,10 +334,6 @@ namespace OpenSim.Framework
if (tickdiff > LongCallTime)
{
m_log.InfoFormat(
<<<<<<< HEAD
"[LOGHTTP]: Slow JSON-RPC request {0} {1} to {2} took {3}ms, {4}ms writing, {5}",
reqnum, method, url, tickdiff, tickdata,
=======
"[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing({5} at Json; {6} at comp), {7} bytes ({8} uncomp): {9}",
reqnum,
method,
@@ -366,7 +344,7 @@ namespace OpenSim.Framework
tickcompressdata,
compsize,
strBuffer != null ? strBuffer.Length : 0,
>>>>>>> avn/ubitvar
strBuffer != null
? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer)
: "");
@@ -823,6 +801,20 @@ namespace OpenSim.Framework
MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, action, maxConnections, null);
}
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
/// <param name="verb"></param>
/// <param name="requestUrl"></param>
/// <param name="obj"></param>
/// <param name="pTimeout">
/// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds)
/// </param>
/// <param name="maxConnections"></param>
/// <returns>
/// The response. If there was an internal exception or the request timed out,
/// then the default(TResponse) is returned.
/// </returns>
public static void MakeRequest<TRequest, TResponse>(string verb,
string requestUrl, TRequest obj, Action<TResponse> action,
int maxConnections, IServiceAuth auth)
@@ -834,7 +826,7 @@ namespace OpenSim.Framework
reqnum, verb, requestUrl);
int tickstart = Util.EnvironmentTickCount();
// int tickdata = 0;
int tickdata = 0;
int tickdiff = 0;
Type type = typeof(TRequest);
@@ -876,27 +868,19 @@ namespace OpenSim.Framework
request.ContentLength = length;
byte[] data = buffer.ToArray();
<<<<<<< HEAD
if (WebUtil.DebugLevel >= 5)
WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data));
request.BeginGetRequestStream(delegate(IAsyncResult res)
=======
// capture how much time was spent writing
// useless in this async
// tickdata = Util.EnvironmentTickCountSubtract(tickstart);
request.BeginGetResponse(delegate(IAsyncResult ar)
>>>>>>> avn/ubitvar
{
using (Stream requestStream = request.EndGetRequestStream(res))
requestStream.Write(data, 0, length);
// capture how much time was spent writing
tickdata = Util.EnvironmentTickCountSubtract(tickstart);
// tickdata = Util.EnvironmentTickCountSubtract(tickstart);
request.BeginGetResponse(delegate(IAsyncResult ar)
{
<<<<<<< HEAD
using (WebResponse response = request.EndGetResponse(ar))
{
try
@@ -911,14 +895,6 @@ namespace OpenSim.Framework
{
}
}
=======
// Let's not close this
// yes do close it
buffer.Close();
respStream.Close();
response.Close();
}
>>>>>>> avn/ubitvar
action(deserial);
@@ -980,7 +956,6 @@ namespace OpenSim.Framework
"[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}",
verb, requestUrl, e.Message, e.StackTrace);
}
<<<<<<< HEAD
// m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
@@ -998,83 +973,34 @@ namespace OpenSim.Framework
}, null);
}
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
if (tickdiff > WebUtil.LongCallTime)
{
string originalRequest = null;
if (buffer != null)
=======
}
catch (Exception e)
{
m_log.ErrorFormat(
"[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}",
verb, requestUrl, e.Message, e.StackTrace);
}
// m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
try
{
action(deserial);
}
catch (Exception e)
>>>>>>> avn/ubitvar
{
originalRequest = Encoding.UTF8.GetString(buffer.ToArray());
<<<<<<< HEAD
if (originalRequest.Length > WebUtil.MaxRequestDiagLength)
originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength);
}
=======
tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
if (tickdiff > WebUtil.LongCallTime)
{
/*
string originalRequest = null;
>>>>>>> avn/ubitvar
m_log.InfoFormat(
m_log.InfoFormat(
"[LOGHTTP]: Slow AsynchronousRequestObject request {0} {1} to {2} took {3}ms, {4}ms writing, {5}",
reqnum, verb, requestUrl, tickdiff, tickdata,
originalRequest);
}
else if (WebUtil.DebugLevel >= 4)
{
m_log.DebugFormat("[LOGHTTP]: HTTP OUT {0} took {1}ms, {2}ms writing",
reqnum, tickdiff, tickdata);
m_log.DebugFormat(
"[WEB UTIL]: HTTP OUT {0} took {1}ms",
reqnum, tickdiff);
}
<<<<<<< HEAD
}
finally
{
if (buffer != null)
buffer.Dispose();
=======
m_log.InfoFormat(
"[ASYNC REQUEST]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
reqnum,
verb,
requestUrl,
tickdiff,
tickdata,
originalRequest);
*/
m_log.InfoFormat(
"[ASYNC REQUEST]: Slow WebRequest SETUP <{0}> {1} {2} took {3}ms",
reqnum,
verb,
requestUrl,
tickdiff);
}
else if (WebUtil.DebugLevel >= 4)
{
m_log.DebugFormat(
"[WEB UTIL]: HTTP OUT {0} took {1}ms",
reqnum, tickdiff);
>>>>>>> avn/ubitvar
}
}
}
@@ -1136,11 +1062,8 @@ namespace OpenSim.Framework
request.ContentLength = length;
byte[] data = buffer.ToArray();
<<<<<<< HEAD
if (WebUtil.DebugLevel >= 5)
WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data));
=======
>>>>>>> avn/ubitvar
Stream requestStream = null;
try
@@ -1188,10 +1111,6 @@ namespace OpenSim.Framework
if (tickdiff > WebUtil.LongCallTime)
{
m_log.InfoFormat(
<<<<<<< HEAD
"[LOGHTTP]: Slow SynchronousRestForms request {0} {1} to {2} took {3}ms, {4}ms writing, {5}",
reqnum, verb, requestUrl, tickdiff, tickdata,
=======
"[FORMS]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
reqnum,
verb,
@@ -1199,7 +1118,6 @@ namespace OpenSim.Framework
tickdiff,
tickset,
tickdata,
>>>>>>> avn/ubitvar
obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj);
}
else if (WebUtil.DebugLevel >= 4)
@@ -1336,8 +1254,6 @@ namespace OpenSim.Framework
ht.ServicePoint.ConnectionLimit = maxConnections;
request.Method = verb;
if (pTimeout != 0)
request.Timeout = pTimeout * 1000;
MemoryStream buffer = null;
try
@@ -1351,29 +1267,17 @@ namespace OpenSim.Framework
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
<<<<<<< HEAD
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
{
XmlSerializer serializer = new XmlSerializer(type);
serializer.Serialize(writer, obj);
writer.Flush();
}
=======
using (XmlWriter writer = XmlWriter.Create(buffer, settings))
{
XmlSerializer serializer = new XmlSerializer(type);
serializer.Serialize(writer, obj);
writer.Flush();
if (WebUtil.DebugLevel >= 5)
WebUtil.LogOutgoingDetail(buffer);
}
>>>>>>> avn/ubitvar
int length = (int)buffer.Length;
request.ContentLength = length;
byte[] data = buffer.ToArray();
<<<<<<< HEAD
if (WebUtil.DebugLevel >= 5)
WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data));
@@ -1397,9 +1301,6 @@ namespace OpenSim.Framework
}
}
=======
Stream requestStream = null;
>>>>>>> avn/ubitvar
try
{
using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse())
@@ -1488,7 +1389,6 @@ namespace OpenSim.Framework
return deserial;
}
public static class XMLResponseHelper
{