mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Update svn properties. Formatting cleanup.
This commit is contained in:
@@ -164,8 +164,8 @@ namespace OpenSim.Framework.Servers
|
||||
if (TryGetAgentHandler(request, response, out agentHandler))
|
||||
{
|
||||
// m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent);
|
||||
if(HandleAgentRequest(agentHandler, request, response))
|
||||
return;
|
||||
if (HandleAgentRequest(agentHandler, request, response))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,22 +177,22 @@ namespace OpenSim.Framework.Servers
|
||||
string handlerKey = GetHandlerKey(request.HttpMethod, path);
|
||||
|
||||
//m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
|
||||
|
||||
|
||||
if (TryGetStreamHandler(handlerKey, out requestHandler))
|
||||
{
|
||||
|
||||
|
||||
// Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
|
||||
byte[] buffer;
|
||||
if (requestHandler is IStreamedRequestHandler)
|
||||
{
|
||||
IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler;
|
||||
|
||||
|
||||
buffer = streamedRequestHandler.Handle(path, request.InputStream, request, response);
|
||||
}
|
||||
else
|
||||
{
|
||||
IStreamHandler streamHandler = (IStreamHandler) requestHandler;
|
||||
|
||||
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
streamHandler.Handle(path, request.InputStream, memoryStream, request, response);
|
||||
@@ -200,11 +200,11 @@ namespace OpenSim.Framework.Servers
|
||||
buffer = memoryStream.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
request.InputStream.Close();
|
||||
if (!response.IsContentTypeSet) response.ContentType = requestHandler.ContentType;
|
||||
response.ContentLength64 = buffer.LongLength;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
response.OutputStream.Write(buffer, 0, buffer.Length);
|
||||
@@ -216,7 +216,7 @@ namespace OpenSim.Framework.Servers
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
switch (request.ContentType)
|
||||
{
|
||||
case null:
|
||||
@@ -479,7 +479,7 @@ namespace OpenSim.Framework.Servers
|
||||
private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response)
|
||||
{
|
||||
|
||||
// In the case of REST, then handler is responsible for ALL aspects of
|
||||
// In the case of REST, then handler is responsible for ALL aspects of
|
||||
// the request/response handling. Nothing is done here, not even encoding.
|
||||
|
||||
try
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenSim.Framework.Servers
|
||||
{
|
||||
public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler
|
||||
{
|
||||
public abstract byte[] Handle(string path, Stream request,
|
||||
public abstract byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse);
|
||||
|
||||
protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path)
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenSim.Framework.Servers
|
||||
get { return _acceptTypes; }
|
||||
}
|
||||
|
||||
public Encoding ContentEncoding
|
||||
public Encoding ContentEncoding
|
||||
{
|
||||
get { return _contentEncoding; }
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers
|
||||
get { return _url; }
|
||||
}
|
||||
|
||||
public string UserAgent
|
||||
public string UserAgent
|
||||
{
|
||||
get { return _userAgent; }
|
||||
}
|
||||
|
||||
@@ -36,36 +36,36 @@ namespace OpenSim.Framework.Servers
|
||||
{
|
||||
private string _contentType;
|
||||
private bool _contentTypeSet;
|
||||
public string ContentType
|
||||
public string ContentType
|
||||
{
|
||||
get { return _contentType; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_contentType = value;
|
||||
_contentTypeSet = true;
|
||||
}
|
||||
}
|
||||
public bool IsContentTypeSet
|
||||
public bool IsContentTypeSet
|
||||
{
|
||||
get { return _contentTypeSet; }
|
||||
}
|
||||
|
||||
private long _contentLength64;
|
||||
public long ContentLength64
|
||||
public long ContentLength64
|
||||
{
|
||||
get { return _contentLength64; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_contentLength64 = value;
|
||||
if (null != _resp) _resp.ContentLength64 = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Encoding _contentEncoding;
|
||||
public Encoding ContentEncoding
|
||||
public Encoding ContentEncoding
|
||||
{
|
||||
get { return _contentEncoding; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_contentEncoding = value;
|
||||
if (null != _resp) _resp.ContentEncoding = value;
|
||||
@@ -76,10 +76,10 @@ namespace OpenSim.Framework.Servers
|
||||
public CookieCollection Cookies;
|
||||
|
||||
private bool _keepAlive;
|
||||
public bool KeepAlive
|
||||
public bool KeepAlive
|
||||
{
|
||||
get { return _keepAlive; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_keepAlive = value;
|
||||
if (null != _resp) _resp.KeepAlive = value;
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Servers
|
||||
public string RedirectLocation
|
||||
{
|
||||
get { return _redirectLocation; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_redirectLocation = value;
|
||||
if (null != _resp) _resp.RedirectLocation = value;
|
||||
@@ -103,7 +103,7 @@ namespace OpenSim.Framework.Servers
|
||||
public bool SendChunked
|
||||
{
|
||||
get { return _sendChunked; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_sendChunked = value;
|
||||
if (null != _resp) _resp.SendChunked = value;
|
||||
@@ -111,10 +111,10 @@ namespace OpenSim.Framework.Servers
|
||||
}
|
||||
|
||||
private int _statusCode;
|
||||
public int StatusCode
|
||||
public int StatusCode
|
||||
{
|
||||
get { return _statusCode; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_statusCode = value;
|
||||
if (null != _resp) _resp.StatusCode = value;
|
||||
@@ -122,10 +122,10 @@ namespace OpenSim.Framework.Servers
|
||||
}
|
||||
|
||||
private string _statusDescription;
|
||||
public string StatusDescription
|
||||
public string StatusDescription
|
||||
{
|
||||
get { return _statusDescription; }
|
||||
set
|
||||
set
|
||||
{
|
||||
_statusDescription = value;
|
||||
if (null != _resp) _resp.StatusDescription = value;
|
||||
|
||||
@@ -41,13 +41,13 @@ namespace OpenSim.Framework.Servers
|
||||
// application level protocol
|
||||
InfoSwitchingProtocols = 101,
|
||||
|
||||
|
||||
|
||||
// 2xx Success codes
|
||||
// 200 Request successful
|
||||
SuccessOk = 200,
|
||||
// 201 Request successful, new resource created
|
||||
SuccessOkCreated = 201,
|
||||
// 202 Request accepted, processing still on-going
|
||||
// 202 Request accepted, processing still on-going
|
||||
SuccessOkAccepted = 202,
|
||||
// 203 Request successful, meta information not authoritative
|
||||
SuccessOkNonAuthoritativeInformation = 203,
|
||||
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Servers
|
||||
|
||||
// 3xx Redirect code: user agent needs to go somewhere else
|
||||
// 300 Redirect: different presentation forms available, take
|
||||
// a pick
|
||||
// a pick
|
||||
RedirectMultipleChoices = 300,
|
||||
// 301 Redirect: requested resource has moved and now lives
|
||||
// somewhere else
|
||||
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Servers
|
||||
// 307 Redirect: Resource temporarily somewhere else, location
|
||||
// might change
|
||||
RedirectMovedTemporarily = 307,
|
||||
|
||||
|
||||
// 4xx Client error: the client borked the request
|
||||
// 400 Client error: bad request, server does not grok what
|
||||
// the client wants
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Servers
|
||||
// deliver, do not try again.
|
||||
ClientErrorForbidden = 403,
|
||||
// 404 Client error: Server cannot find anything matching the
|
||||
// client request.
|
||||
// client request.
|
||||
ClientErrorNotFound = 404,
|
||||
// 405 Client error: The method specified by the client in the
|
||||
// request is not allowed for the resource requested
|
||||
@@ -148,7 +148,7 @@ namespace OpenSim.Framework.Servers
|
||||
// 501 Server error: The server does not do the functionality
|
||||
// required to carry out the client request. not at
|
||||
// all. certainly not before breakfast. but also not after
|
||||
// breakfast.
|
||||
// breakfast.
|
||||
ServerErrorNotImplemented = 501,
|
||||
// 502 Server error: While acting as a proxy or a gateway, the
|
||||
// server got ditched by the upstream server and as a
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Servers
|
||||
m_method = method;
|
||||
}
|
||||
|
||||
public void Handle(string path, Stream request, Stream responseStream,
|
||||
public void Handle(string path, Stream request, Stream responseStream,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
{
|
||||
TRequest deserial;
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
|
||||
namespace OpenSim.Framework.Servers
|
||||
{
|
||||
public delegate string RestMethod(string request, string path, string param,
|
||||
public delegate string RestMethod(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user