mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
add SimpleStrem(Request)Handler, for simple uripaths, any method or query
This commit is contained in:
@@ -618,24 +618,35 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
Culture.SetCurrentCulture();
|
||||
|
||||
// // This is the REST agent interface. We require an agent to properly identify
|
||||
// // itself. If the REST handler recognizes the prefix it will attempt to
|
||||
// // satisfy the request. If it is not recognizable, and no damage has occurred
|
||||
// // the request can be passed through to the other handlers. This is a low
|
||||
// // probability event; if a request is matched it is normally expected to be
|
||||
// // handled
|
||||
// IHttpAgentHandler agentHandler;
|
||||
//
|
||||
// if (TryGetAgentHandler(request, response, out agentHandler))
|
||||
// {
|
||||
// if (HandleAgentRequest(agentHandler, request, response))
|
||||
// {
|
||||
// requestEndTick = Environment.TickCount;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// // This is the REST agent interface. We require an agent to properly identify
|
||||
// // itself. If the REST handler recognizes the prefix it will attempt to
|
||||
// // satisfy the request. If it is not recognizable, and no damage has occurred
|
||||
// // the request can be passed through to the other handlers. This is a low
|
||||
// // probability event; if a request is matched it is normally expected to be
|
||||
// // handled
|
||||
// IHttpAgentHandler agentHandler;
|
||||
//
|
||||
// if (TryGetAgentHandler(request, response, out agentHandler))
|
||||
// {
|
||||
// if (HandleAgentRequest(agentHandler, request, response))
|
||||
// {
|
||||
// requestEndTick = Environment.TickCount;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
string path = request.UriPath;
|
||||
if (!string.IsNullOrWhiteSpace(path) && TryGetSimpleStreamHandler(path, out ISimpleStreamHandler hdr))
|
||||
{
|
||||
hdr.Handle(request, response);
|
||||
if (request.InputStream != null && request.InputStream.CanRead)
|
||||
request.InputStream.Dispose();
|
||||
|
||||
string path = request.RawUrl;
|
||||
requestEndTick = Environment.TickCount;
|
||||
response.Send();
|
||||
return;
|
||||
}
|
||||
|
||||
path = request.RawUrl;
|
||||
string handlerKey = GetHandlerKey(request.HttpMethod, path);
|
||||
byte[] buffer = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user