Merge branch 'master' into careminster

Conflicts:
	OpenSim/Framework/Monitoring/BaseStatsCollector.cs
	OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
	OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
This commit is contained in:
Melanie
2013-06-23 01:59:57 +01:00
35 changed files with 958 additions and 954 deletions

View File

@@ -54,7 +54,6 @@ namespace OpenSim.Framework.Servers.HttpServer
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private HttpServerLogWriter httpserverlog = new HttpServerLogWriter();
/// <summary>
/// This is a pending websocket request before it got an sucessful upgrade response.
/// The consumer must call handler.HandshakeAndUpgrade() to signal to the handler to
@@ -81,6 +80,11 @@ namespace OpenSim.Framework.Servers.HttpServer
/// </remarks>
public int RequestNumber { get; private set; }
/// <summary>
/// Statistic for holding number of requests processed.
/// </summary>
private Stat m_requestsProcessedStat;
private volatile int NotSocketErrors = 0;
public volatile bool HTTPDRunning = false;
@@ -437,9 +441,8 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request)
private void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request)
{
OSHttpRequest req = new OSHttpRequest(context, request);
WebSocketRequestDelegate dWebSocketRequestDelegate = null;
lock (m_WebSocketHandlers)
@@ -455,8 +458,7 @@ namespace OpenSim.Framework.Servers.HttpServer
OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
resp.ReuseContext = true;
HandleRequest(req, resp);
HandleRequest(req, resp);
// !!!HACK ALERT!!!
// There seems to be a bug in the underlying http code that makes subsequent requests
@@ -1870,6 +1872,21 @@ namespace OpenSim.Framework.Servers.HttpServer
// useful without inbound HTTP.
throw e;
}
m_requestsProcessedStat
= new Stat(
"HTTPRequestsServed",
"Number of inbound HTTP requests processed",
"",
"requests",
"httpserver",
Port.ToString(),
StatType.Pull,
MeasuresOfInterest.AverageChangeOverTime,
stat => stat.Value = RequestNumber,
StatVerbosity.Debug);
StatsManager.RegisterStat(m_requestsProcessedStat);
}
public void httpServerDisconnectMonitor(IHttpClientContext source, SocketError err)
@@ -1902,6 +1919,9 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Stop()
{
HTTPDRunning = false;
StatsManager.DeregisterStat(m_requestsProcessedStat);
try
{
m_PollServiceManager.Stop();

View File

@@ -75,7 +75,7 @@ namespace OpenSim.Framework.Servers.HttpServer
/// <summary>
/// This is a regular HTTP Request... This may be removed in the future.
/// </summary>
public event RegularHttpRequestDelegate OnRegularHttpRequest;
// public event RegularHttpRequestDelegate OnRegularHttpRequest;
/// <summary>
/// When the upgrade from a HTTP request to a Websocket is completed, this will be fired
@@ -304,15 +304,14 @@ namespace OpenSim.Framework.Servers.HttpServer
if (d != null)
d(this, new UpgradeCompletedEventArgs());
}
catch (IOException fail)
catch (IOException)
{
Close(string.Empty);
}
catch (ObjectDisposedException fail)
catch (ObjectDisposedException)
{
Close(string.Empty);
}
}
}
/// <summary>
@@ -414,8 +413,6 @@ namespace OpenSim.Framework.Servers.HttpServer
_socketState.Header = pheader;
}
if (_socketState.FrameComplete)
{
ProcessFrame(_socketState);
@@ -424,7 +421,6 @@ namespace OpenSim.Framework.Servers.HttpServer
_socketState.ExpectedBytes = 0;
}
}
}
else
@@ -457,8 +453,7 @@ namespace OpenSim.Framework.Servers.HttpServer
_socketState.ReceivedBytes.Clear();
_socketState.ExpectedBytes = 0;
// do some processing
}
}
}
}
if (offset > 0)
@@ -477,13 +472,12 @@ namespace OpenSim.Framework.Servers.HttpServer
{
// We can't read the stream anymore...
}
}
catch (IOException fail)
catch (IOException)
{
Close(string.Empty);
}
catch (ObjectDisposedException fail)
catch (ObjectDisposedException)
{
Close(string.Empty);
}