Merge branch 'master' into httptests

This commit is contained in:
UbitUmarov
2016-11-27 15:14:34 +00:00
47 changed files with 645 additions and 318 deletions

View File

@@ -155,7 +155,7 @@ namespace OpenSim.Framework
}
}
public virtual byte[] Data
public byte[] Data
{
get { return m_data; }
set { m_data = value; }

View File

@@ -136,7 +136,8 @@ namespace OpenSim.Framework.Monitoring
if(m_jobQueue.Count <= 0)
m_cancelSource.Cancel();
m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop);
if(m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop))
m_finishedProcessingAfterStop.Close();
}
finally
{

View File

@@ -176,6 +176,9 @@ namespace OpenSim.Framework
/// </remarks>
public uint RegionSizeZ = Constants.RegionHeight;
// If entering avatar has no specific coords, this is where they land
public Vector3 DefaultLandingPoint = new Vector3(128, 128, 30);
private Dictionary<String, String> m_extraSettings = new Dictionary<string, string>();
// Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
@@ -712,6 +715,19 @@ namespace OpenSim.Framework
m_regionType = config.GetString("RegionType", String.Empty);
allKeys.Remove("RegionType");
// Get Default Landing Location (Defaults to 128,128)
string temp_location = config.GetString("DefaultLanding", "<128, 128, 30>");
Vector3 temp_vector;
if (Vector3.TryParse(temp_location, out temp_vector))
DefaultLandingPoint = temp_vector;
else
m_log.ErrorFormat("[RegionInfo]: Unable to parse DefaultLanding for '{0}'. The value given was '{1}'", RegionName, temp_location);
allKeys.Remove("DefaultLanding");
DoDefaultLandingSanityChecks();
#region Prim and map stuff
m_nonphysPrimMin = config.GetFloat("NonPhysicalPrimMin", 0);
@@ -764,6 +780,48 @@ namespace OpenSim.Framework
}
}
// Make sure DefaultLanding is within region borders with a buffer zone 5 meters from borders
private void DoDefaultLandingSanityChecks()
{
// Sanity Check Default Landing
float buffer_zone = 5f;
bool ValuesCapped = false;
// Minimum Positions
if (DefaultLandingPoint.X < buffer_zone)
{
DefaultLandingPoint.X = buffer_zone;
ValuesCapped = true;
}
if (DefaultLandingPoint.Y < buffer_zone)
{
DefaultLandingPoint.Y = buffer_zone;
ValuesCapped = true;
}
// Maximum Positions
if (DefaultLandingPoint.X > RegionSizeX - buffer_zone)
{
DefaultLandingPoint.X = RegionSizeX - buffer_zone;
ValuesCapped = true;
}
if (DefaultLandingPoint.Y > RegionSizeY - buffer_zone)
{
DefaultLandingPoint.Y = RegionSizeY - buffer_zone;
ValuesCapped = true;
}
// Height
if (DefaultLandingPoint.Z < 0f)
DefaultLandingPoint.Z = 0f;
if (ValuesCapped == true)
m_log.WarnFormat("[RegionInfo]: The default landing location for {0} has been capped to {1}", RegionName, DefaultLandingPoint);
}
// Make sure user specified region sizes are sane.
// Must be multiples of legacy region size (256).
private void DoRegionSizeSanityChecks()

View File

@@ -430,11 +430,11 @@ namespace OpenSim.Framework
using (Stream dst = _request.GetRequestStream())
{
m_log.Info("[REST]: GetRequestStream is ok");
m_log.Debug("[REST]: GetRequestStream is ok");
byte[] buf = new byte[1024];
int length = src.Read(buf, 0, 1024);
m_log.Info("[REST]: First Read is ok");
m_log.Debug("[REST]: First Read is ok");
while (length > 0)
{
dst.Write(buf, 0, length);

View File

@@ -1019,7 +1019,8 @@ namespace OpenSim.Framework
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs, IServiceAuth auth)
public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs = -1,
IServiceAuth auth = null, bool keepalive = true)
{
int reqnum = WebUtil.RequestNumber++;
@@ -1034,6 +1035,8 @@ namespace OpenSim.Framework
request.Method = verb;
if (timeoutsecs > 0)
request.Timeout = timeoutsecs * 1000;
if(!keepalive && request is HttpWebRequest)
((HttpWebRequest)request).KeepAlive = false;
if (auth != null)
auth.AddAuthorization(request.Headers);
@@ -1125,16 +1128,6 @@ namespace OpenSim.Framework
return respstring;
}
public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs)
{
return MakeRequest(verb, requestUrl, obj, timeoutsecs, null);
}
public static string MakeRequest(string verb, string requestUrl, string obj)
{
return MakeRequest(verb, requestUrl, obj, -1);
}
public static string MakeRequest(string verb, string requestUrl, string obj, IServiceAuth auth)
{
return MakeRequest(verb, requestUrl, obj, -1, auth);