diff options
author | Oren Hurvitz | 2014-04-01 15:00:22 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-04-02 06:32:41 +0100 |
commit | bbfda8e19e4a66d87ba1de80083a0da1eaf9ddfb (patch) | |
tree | 1c6be779994d00cfcfcfc849fcc71ac7a8ffa438 /OpenSim | |
parent | Fixed the "Update Asset" handler: it was looking for the Asset ID in the wron... (diff) | |
download | opensim-SC_OLD-bbfda8e19e4a66d87ba1de80083a0da1eaf9ddfb.zip opensim-SC_OLD-bbfda8e19e4a66d87ba1de80083a0da1eaf9ddfb.tar.gz opensim-SC_OLD-bbfda8e19e4a66d87ba1de80083a0da1eaf9ddfb.tar.bz2 opensim-SC_OLD-bbfda8e19e4a66d87ba1de80083a0da1eaf9ddfb.tar.xz |
Fixed last-resort sending of error response (HTTP 500) when an error occurs while handling a request.
The previous code didn't actually send the response, so the caller was stuck until the timeout (100 seconds).
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 8 | ||||
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 28324a5..7041181 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -492,8 +492,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
492 | try | 492 | try |
493 | { | 493 | { |
494 | byte[] buffer500 = SendHTML500(response); | 494 | byte[] buffer500 = SendHTML500(response); |
495 | response.Body.Write(buffer500,0,buffer500.Length); | 495 | response.OutputStream.Write(buffer500, 0, buffer500.Length); |
496 | response.Body.Close(); | 496 | response.Send(); |
497 | } | 497 | } |
498 | catch | 498 | catch |
499 | { | 499 | { |
@@ -746,8 +746,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
746 | try | 746 | try |
747 | { | 747 | { |
748 | byte[] buffer500 = SendHTML500(response); | 748 | byte[] buffer500 = SendHTML500(response); |
749 | response.Body.Write(buffer500, 0, buffer500.Length); | 749 | response.OutputStream.Write(buffer500, 0, buffer500.Length); |
750 | response.Body.Close(); | 750 | response.Send(); |
751 | } | 751 | } |
752 | catch | 752 | catch |
753 | { | 753 | { |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 40c1634..768ff16 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -1203,9 +1203,9 @@ namespace OpenSim.Framework | |||
1203 | if (hwr != null && hwr.StatusCode == HttpStatusCode.NotFound) | 1203 | if (hwr != null && hwr.StatusCode == HttpStatusCode.NotFound) |
1204 | return deserial; | 1204 | return deserial; |
1205 | else | 1205 | else |
1206 | m_log.ErrorFormat( | 1206 | m_log.Error(string.Format( |
1207 | "[SynchronousRestObjectRequester]: WebException for {0} {1} {2}: {3} {4}", | 1207 | "[SynchronousRestObjectRequester]: WebException for {0} {1} {2} ", |
1208 | verb, requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace); | 1208 | verb, requestUrl, typeof(TResponse).ToString()), e); |
1209 | } | 1209 | } |
1210 | } | 1210 | } |
1211 | catch (System.InvalidOperationException) | 1211 | catch (System.InvalidOperationException) |
@@ -1217,9 +1217,9 @@ namespace OpenSim.Framework | |||
1217 | } | 1217 | } |
1218 | catch (Exception e) | 1218 | catch (Exception e) |
1219 | { | 1219 | { |
1220 | m_log.DebugFormat( | 1220 | m_log.Debug(string.Format( |
1221 | "[SynchronousRestObjectRequester]: Exception on response from {0} {1}: {2}{3}", | 1221 | "[SynchronousRestObjectRequester]: Exception on response from {0} {1} ", |
1222 | verb, requestUrl, e.Message, e.StackTrace); | 1222 | verb, requestUrl), e); |
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); | 1225 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); |