diff options
author | Dr Scofield | 2008-06-30 11:57:47 +0000 |
---|---|---|
committer | Dr Scofield | 2008-06-30 11:57:47 +0000 |
commit | 313f7f60fda81c987e0ac4da4dc8c2f5def46b72 (patch) | |
tree | 71c30ab49c97a17d157c59877842d159f5eac3e1 /OpenSim/Framework/Servers | |
parent | disables spam-like debugging messages inadvertently left on in last commit (o... (diff) | |
download | opensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.zip opensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.tar.gz opensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.tar.bz2 opensim-SC-313f7f60fda81c987e0ac4da4dc8c2f5def46b72.tar.xz |
properly explaining each #pragma warning disable
massaging OSHttpRequestPump to not abort on exceptions...
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/OSHttpHandler.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/OSHttpRequestPump.cs | 64 |
2 files changed, 39 insertions, 26 deletions
diff --git a/OpenSim/Framework/Servers/OSHttpHandler.cs b/OpenSim/Framework/Servers/OSHttpHandler.cs index c4ab81c..da96cca 100644 --- a/OpenSim/Framework/Servers/OSHttpHandler.cs +++ b/OpenSim/Framework/Servers/OSHttpHandler.cs | |||
@@ -57,6 +57,7 @@ namespace OpenSim.Framework.Servers | |||
57 | /// </summary> | 57 | /// </summary> |
58 | public enum OSHttpHandlerResult | 58 | public enum OSHttpHandlerResult |
59 | { | 59 | { |
60 | Unprocessed, | ||
60 | Pass, | 61 | Pass, |
61 | Handled, | 62 | Handled, |
62 | Detached, | 63 | Detached, |
diff --git a/OpenSim/Framework/Servers/OSHttpRequestPump.cs b/OpenSim/Framework/Servers/OSHttpRequestPump.cs index 3459cc6..44fba47 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestPump.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestPump.cs | |||
@@ -98,42 +98,54 @@ namespace OpenSim.Framework.Servers | |||
98 | { | 98 | { |
99 | OSHttpRequest req = null; | 99 | OSHttpRequest req = null; |
100 | 100 | ||
101 | try { | 101 | while (true) |
102 | while (true) | 102 | { |
103 | { | 103 | try { |
104 | // get job to do | 104 | // dequeue an OSHttpRequest from OSHttpServer's |
105 | // request queue | ||
105 | req = _queue.Dequeue(); | 106 | req = _queue.Dequeue(); |
106 | 107 | ||
107 | // get list of registered handlers | 108 | // get a copy of the list of registered handlers |
108 | List<OSHttpHandler> handlers = _server.OSHttpHandlers; | 109 | List<OSHttpHandler> handlers = _server.OSHttpHandlers; |
109 | 110 | ||
110 | // prune list and sort from most specific to least | 111 | // prune list and have it sorted from most |
111 | // specific | 112 | // specific to least specific |
112 | handlers = MatchHandlers(req, handlers); | 113 | handlers = MatchHandlers(req, handlers); |
113 | 114 | ||
114 | // process req | 115 | // process req: we try each handler in turn until |
116 | // we are either out of handlers or get back a | ||
117 | // Handled or Detached | ||
118 | OSHttpHandlerResult rc = OSHttpHandlerResult.Unprocessed; | ||
115 | foreach(OSHttpHandler h in handlers) | 119 | foreach(OSHttpHandler h in handlers) |
116 | { | 120 | { |
117 | OSHttpHandlerResult rc = h.Process(req); | 121 | rc = h.Process(req); |
118 | // handler did not process the request, try | 122 | |
119 | // next handler | 123 | // Pass: handler did not process the request, |
124 | // try next handler | ||
120 | if (OSHttpHandlerResult.Pass == rc) continue; | 125 | if (OSHttpHandlerResult.Pass == rc) continue; |
121 | // handler is taking over processing of | 126 | // Detached: handler is taking over processing |
122 | // request, we are done | 127 | // of request, we are done |
123 | if (OSHttpHandlerResult.Detached == rc) break; | 128 | if (OSHttpHandlerResult.Detached == rc) break; |
124 | 129 | ||
125 | // request was handled, we need to clean up | 130 | if (OSHttpHandlerResult.Handled != rc) |
126 | // TODO: cleanup :-) | 131 | { |
127 | 132 | // something went wrong | |
133 | throw new Exception(String.Format("[{0}] got unexpected OSHttpHandlerResult {1}", EngineID, rc)); | ||
134 | } | ||
135 | |||
136 | // Handled: clean up | ||
137 | // response.KeepAlive = false; | ||
138 | // response.SendChunked = false; | ||
139 | |||
128 | break; | 140 | break; |
129 | } | 141 | } |
130 | 142 | ||
143 | } | ||
144 | catch (Exception e) | ||
145 | { | ||
146 | _log.DebugFormat("[{0}] OSHttpHandler problem: {1}", EngineID, e.ToString()); | ||
147 | _log.ErrorFormat("[{0}] OSHttpHandler problem: {1}", EngineID, e.Message); | ||
131 | } | 148 | } |
132 | } | ||
133 | catch (Exception e) | ||
134 | { | ||
135 | _log.DebugFormat("[{0}] something went wrong: {1}", EngineID, e.ToString()); | ||
136 | _log.ErrorFormat("[{0}] something went wrong: {1}, terminating this pump", EngineID, e.Message); | ||
137 | } | 149 | } |
138 | } | 150 | } |
139 | 151 | ||