aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers
diff options
context:
space:
mode:
authorJeff Ames2008-05-25 23:27:38 +0000
committerJeff Ames2008-05-25 23:27:38 +0000
commit5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d (patch)
treeb010c015ac515fe2a3dd0c9f89c16cbc6383d685 /OpenSim/Framework/Servers
parent* A hacky Top Scripts display. It isn't accurate as far as ms accounting, ho... (diff)
downloadopensim-SC_OLD-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.zip
opensim-SC_OLD-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.tar.gz
opensim-SC_OLD-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.tar.bz2
opensim-SC_OLD-5d77625e9ac4ce1fc7b8fd67aabf563678ef0d5d.tar.xz
Update svn properties. Formatting cleanup.
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs20
-rw-r--r--OpenSim/Framework/Servers/BaseStreamHandler.cs2
-rw-r--r--OpenSim/Framework/Servers/OSHttpRequest.cs4
-rw-r--r--OpenSim/Framework/Servers/OSHttpResponse.cs32
-rw-r--r--OpenSim/Framework/Servers/OSHttpStatusCodes.cs12
-rw-r--r--OpenSim/Framework/Servers/RestDeserialiseHandler.cs2
-rw-r--r--OpenSim/Framework/Servers/RestMethod.cs2
7 files changed, 37 insertions, 37 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 91b5718..fa64b41 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -164,8 +164,8 @@ namespace OpenSim.Framework.Servers
164 if (TryGetAgentHandler(request, response, out agentHandler)) 164 if (TryGetAgentHandler(request, response, out agentHandler))
165 { 165 {
166 // m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent); 166 // m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent);
167 if(HandleAgentRequest(agentHandler, request, response)) 167 if (HandleAgentRequest(agentHandler, request, response))
168 return; 168 return;
169 } 169 }
170 } 170 }
171 171
@@ -177,22 +177,22 @@ namespace OpenSim.Framework.Servers
177 string handlerKey = GetHandlerKey(request.HttpMethod, path); 177 string handlerKey = GetHandlerKey(request.HttpMethod, path);
178 178
179 //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); 179 //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
180 180
181 if (TryGetStreamHandler(handlerKey, out requestHandler)) 181 if (TryGetStreamHandler(handlerKey, out requestHandler))
182 { 182 {
183 183
184 // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. 184 // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
185 byte[] buffer; 185 byte[] buffer;
186 if (requestHandler is IStreamedRequestHandler) 186 if (requestHandler is IStreamedRequestHandler)
187 { 187 {
188 IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; 188 IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler;
189 189
190 buffer = streamedRequestHandler.Handle(path, request.InputStream, request, response); 190 buffer = streamedRequestHandler.Handle(path, request.InputStream, request, response);
191 } 191 }
192 else 192 else
193 { 193 {
194 IStreamHandler streamHandler = (IStreamHandler) requestHandler; 194 IStreamHandler streamHandler = (IStreamHandler) requestHandler;
195 195
196 using (MemoryStream memoryStream = new MemoryStream()) 196 using (MemoryStream memoryStream = new MemoryStream())
197 { 197 {
198 streamHandler.Handle(path, request.InputStream, memoryStream, request, response); 198 streamHandler.Handle(path, request.InputStream, memoryStream, request, response);
@@ -200,11 +200,11 @@ namespace OpenSim.Framework.Servers
200 buffer = memoryStream.ToArray(); 200 buffer = memoryStream.ToArray();
201 } 201 }
202 } 202 }
203 203
204 request.InputStream.Close(); 204 request.InputStream.Close();
205 if (!response.IsContentTypeSet) response.ContentType = requestHandler.ContentType; 205 if (!response.IsContentTypeSet) response.ContentType = requestHandler.ContentType;
206 response.ContentLength64 = buffer.LongLength; 206 response.ContentLength64 = buffer.LongLength;
207 207
208 try 208 try
209 { 209 {
210 response.OutputStream.Write(buffer, 0, buffer.Length); 210 response.OutputStream.Write(buffer, 0, buffer.Length);
@@ -216,7 +216,7 @@ namespace OpenSim.Framework.Servers
216 } 216 }
217 return; 217 return;
218 } 218 }
219 219
220 switch (request.ContentType) 220 switch (request.ContentType)
221 { 221 {
222 case null: 222 case null:
@@ -479,7 +479,7 @@ namespace OpenSim.Framework.Servers
479 private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response) 479 private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response)
480 { 480 {
481 481
482 // In the case of REST, then handler is responsible for ALL aspects of 482 // In the case of REST, then handler is responsible for ALL aspects of
483 // the request/response handling. Nothing is done here, not even encoding. 483 // the request/response handling. Nothing is done here, not even encoding.
484 484
485 try 485 try
diff --git a/OpenSim/Framework/Servers/BaseStreamHandler.cs b/OpenSim/Framework/Servers/BaseStreamHandler.cs
index a81a1b7..6b0614f 100644
--- a/OpenSim/Framework/Servers/BaseStreamHandler.cs
+++ b/OpenSim/Framework/Servers/BaseStreamHandler.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Framework.Servers
32{ 32{
33 public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler 33 public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler
34 { 34 {
35 public abstract byte[] Handle(string path, Stream request, 35 public abstract byte[] Handle(string path, Stream request,
36 OSHttpRequest httpRequest, OSHttpResponse httpResponse); 36 OSHttpRequest httpRequest, OSHttpResponse httpResponse);
37 37
38 protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path) 38 protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path)
diff --git a/OpenSim/Framework/Servers/OSHttpRequest.cs b/OpenSim/Framework/Servers/OSHttpRequest.cs
index 212e224..a290e0e 100644
--- a/OpenSim/Framework/Servers/OSHttpRequest.cs
+++ b/OpenSim/Framework/Servers/OSHttpRequest.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Framework.Servers
55 get { return _acceptTypes; } 55 get { return _acceptTypes; }
56 } 56 }
57 57
58 public Encoding ContentEncoding 58 public Encoding ContentEncoding
59 { 59 {
60 get { return _contentEncoding; } 60 get { return _contentEncoding; }
61 } 61 }
@@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers
110 get { return _url; } 110 get { return _url; }
111 } 111 }
112 112
113 public string UserAgent 113 public string UserAgent
114 { 114 {
115 get { return _userAgent; } 115 get { return _userAgent; }
116 } 116 }
diff --git a/OpenSim/Framework/Servers/OSHttpResponse.cs b/OpenSim/Framework/Servers/OSHttpResponse.cs
index 28d513a..72be790 100644
--- a/OpenSim/Framework/Servers/OSHttpResponse.cs
+++ b/OpenSim/Framework/Servers/OSHttpResponse.cs
@@ -36,36 +36,36 @@ namespace OpenSim.Framework.Servers
36 { 36 {
37 private string _contentType; 37 private string _contentType;
38 private bool _contentTypeSet; 38 private bool _contentTypeSet;
39 public string ContentType 39 public string ContentType
40 { 40 {
41 get { return _contentType; } 41 get { return _contentType; }
42 set 42 set
43 { 43 {
44 _contentType = value; 44 _contentType = value;
45 _contentTypeSet = true; 45 _contentTypeSet = true;
46 } 46 }
47 } 47 }
48 public bool IsContentTypeSet 48 public bool IsContentTypeSet
49 { 49 {
50 get { return _contentTypeSet; } 50 get { return _contentTypeSet; }
51 } 51 }
52 52
53 private long _contentLength64; 53 private long _contentLength64;
54 public long ContentLength64 54 public long ContentLength64
55 { 55 {
56 get { return _contentLength64; } 56 get { return _contentLength64; }
57 set 57 set
58 { 58 {
59 _contentLength64 = value; 59 _contentLength64 = value;
60 if (null != _resp) _resp.ContentLength64 = value; 60 if (null != _resp) _resp.ContentLength64 = value;
61 } 61 }
62 } 62 }
63 63
64 private Encoding _contentEncoding; 64 private Encoding _contentEncoding;
65 public Encoding ContentEncoding 65 public Encoding ContentEncoding
66 { 66 {
67 get { return _contentEncoding; } 67 get { return _contentEncoding; }
68 set 68 set
69 { 69 {
70 _contentEncoding = value; 70 _contentEncoding = value;
71 if (null != _resp) _resp.ContentEncoding = value; 71 if (null != _resp) _resp.ContentEncoding = value;
@@ -76,10 +76,10 @@ namespace OpenSim.Framework.Servers
76 public CookieCollection Cookies; 76 public CookieCollection Cookies;
77 77
78 private bool _keepAlive; 78 private bool _keepAlive;
79 public bool KeepAlive 79 public bool KeepAlive
80 { 80 {
81 get { return _keepAlive; } 81 get { return _keepAlive; }
82 set 82 set
83 { 83 {
84 _keepAlive = value; 84 _keepAlive = value;
85 if (null != _resp) _resp.KeepAlive = value; 85 if (null != _resp) _resp.KeepAlive = value;
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Servers
92 public string RedirectLocation 92 public string RedirectLocation
93 { 93 {
94 get { return _redirectLocation; } 94 get { return _redirectLocation; }
95 set 95 set
96 { 96 {
97 _redirectLocation = value; 97 _redirectLocation = value;
98 if (null != _resp) _resp.RedirectLocation = value; 98 if (null != _resp) _resp.RedirectLocation = value;
@@ -103,7 +103,7 @@ namespace OpenSim.Framework.Servers
103 public bool SendChunked 103 public bool SendChunked
104 { 104 {
105 get { return _sendChunked; } 105 get { return _sendChunked; }
106 set 106 set
107 { 107 {
108 _sendChunked = value; 108 _sendChunked = value;
109 if (null != _resp) _resp.SendChunked = value; 109 if (null != _resp) _resp.SendChunked = value;
@@ -111,10 +111,10 @@ namespace OpenSim.Framework.Servers
111 } 111 }
112 112
113 private int _statusCode; 113 private int _statusCode;
114 public int StatusCode 114 public int StatusCode
115 { 115 {
116 get { return _statusCode; } 116 get { return _statusCode; }
117 set 117 set
118 { 118 {
119 _statusCode = value; 119 _statusCode = value;
120 if (null != _resp) _resp.StatusCode = value; 120 if (null != _resp) _resp.StatusCode = value;
@@ -122,10 +122,10 @@ namespace OpenSim.Framework.Servers
122 } 122 }
123 123
124 private string _statusDescription; 124 private string _statusDescription;
125 public string StatusDescription 125 public string StatusDescription
126 { 126 {
127 get { return _statusDescription; } 127 get { return _statusDescription; }
128 set 128 set
129 { 129 {
130 _statusDescription = value; 130 _statusDescription = value;
131 if (null != _resp) _resp.StatusDescription = value; 131 if (null != _resp) _resp.StatusDescription = value;
diff --git a/OpenSim/Framework/Servers/OSHttpStatusCodes.cs b/OpenSim/Framework/Servers/OSHttpStatusCodes.cs
index 9a04d82..42f172b 100644
--- a/OpenSim/Framework/Servers/OSHttpStatusCodes.cs
+++ b/OpenSim/Framework/Servers/OSHttpStatusCodes.cs
@@ -41,13 +41,13 @@ namespace OpenSim.Framework.Servers
41 // application level protocol 41 // application level protocol
42 InfoSwitchingProtocols = 101, 42 InfoSwitchingProtocols = 101,
43 43
44 44
45 // 2xx Success codes 45 // 2xx Success codes
46 // 200 Request successful 46 // 200 Request successful
47 SuccessOk = 200, 47 SuccessOk = 200,
48 // 201 Request successful, new resource created 48 // 201 Request successful, new resource created
49 SuccessOkCreated = 201, 49 SuccessOkCreated = 201,
50 // 202 Request accepted, processing still on-going 50 // 202 Request accepted, processing still on-going
51 SuccessOkAccepted = 202, 51 SuccessOkAccepted = 202,
52 // 203 Request successful, meta information not authoritative 52 // 203 Request successful, meta information not authoritative
53 SuccessOkNonAuthoritativeInformation = 203, 53 SuccessOkNonAuthoritativeInformation = 203,
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Servers
60 60
61 // 3xx Redirect code: user agent needs to go somewhere else 61 // 3xx Redirect code: user agent needs to go somewhere else
62 // 300 Redirect: different presentation forms available, take 62 // 300 Redirect: different presentation forms available, take
63 // a pick 63 // a pick
64 RedirectMultipleChoices = 300, 64 RedirectMultipleChoices = 300,
65 // 301 Redirect: requested resource has moved and now lives 65 // 301 Redirect: requested resource has moved and now lives
66 // somewhere else 66 // somewhere else
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Servers
78 // 307 Redirect: Resource temporarily somewhere else, location 78 // 307 Redirect: Resource temporarily somewhere else, location
79 // might change 79 // might change
80 RedirectMovedTemporarily = 307, 80 RedirectMovedTemporarily = 307,
81 81
82 // 4xx Client error: the client borked the request 82 // 4xx Client error: the client borked the request
83 // 400 Client error: bad request, server does not grok what 83 // 400 Client error: bad request, server does not grok what
84 // the client wants 84 // the client wants
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Servers
92 // deliver, do not try again. 92 // deliver, do not try again.
93 ClientErrorForbidden = 403, 93 ClientErrorForbidden = 403,
94 // 404 Client error: Server cannot find anything matching the 94 // 404 Client error: Server cannot find anything matching the
95 // client request. 95 // client request.
96 ClientErrorNotFound = 404, 96 ClientErrorNotFound = 404,
97 // 405 Client error: The method specified by the client in the 97 // 405 Client error: The method specified by the client in the
98 // request is not allowed for the resource requested 98 // request is not allowed for the resource requested
@@ -148,7 +148,7 @@ namespace OpenSim.Framework.Servers
148 // 501 Server error: The server does not do the functionality 148 // 501 Server error: The server does not do the functionality
149 // required to carry out the client request. not at 149 // required to carry out the client request. not at
150 // all. certainly not before breakfast. but also not after 150 // all. certainly not before breakfast. but also not after
151 // breakfast. 151 // breakfast.
152 ServerErrorNotImplemented = 501, 152 ServerErrorNotImplemented = 501,
153 // 502 Server error: While acting as a proxy or a gateway, the 153 // 502 Server error: While acting as a proxy or a gateway, the
154 // server got ditched by the upstream server and as a 154 // server got ditched by the upstream server and as a
diff --git a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs
index fcc8839..99358aa 100644
--- a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs
+++ b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Servers
45 m_method = method; 45 m_method = method;
46 } 46 }
47 47
48 public void Handle(string path, Stream request, Stream responseStream, 48 public void Handle(string path, Stream request, Stream responseStream,
49 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 49 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
50 { 50 {
51 TRequest deserial; 51 TRequest deserial;
diff --git a/OpenSim/Framework/Servers/RestMethod.cs b/OpenSim/Framework/Servers/RestMethod.cs
index 6bd34f5..e58e270 100644
--- a/OpenSim/Framework/Servers/RestMethod.cs
+++ b/OpenSim/Framework/Servers/RestMethod.cs
@@ -27,6 +27,6 @@
27 27
28namespace OpenSim.Framework.Servers 28namespace OpenSim.Framework.Servers
29{ 29{
30 public delegate string RestMethod(string request, string path, string param, 30 public delegate string RestMethod(string request, string path, string param,
31 OSHttpRequest httpRequest, OSHttpResponse httpResponse); 31 OSHttpRequest httpRequest, OSHttpResponse httpResponse);
32} 32}