diff options
author | Tom | 2011-05-17 19:12:37 -0700 |
---|---|---|
committer | Tom | 2011-05-17 19:12:37 -0700 |
commit | 74dd619575c2e260ba680312a87249e284f3d2c9 (patch) | |
tree | 38f3a3f9bd3ab6095b1269ed7e6666e14e5bf0f4 /OpenSim/Framework | |
parent | Also fix the locking of url.requests and tidy the locks in general (diff) | |
download | opensim-SC_OLD-74dd619575c2e260ba680312a87249e284f3d2c9.zip opensim-SC_OLD-74dd619575c2e260ba680312a87249e284f3d2c9.tar.gz opensim-SC_OLD-74dd619575c2e260ba680312a87249e284f3d2c9.tar.bz2 opensim-SC_OLD-74dd619575c2e260ba680312a87249e284f3d2c9.tar.xz |
If a response cannot be obtained (the script has no handler) return a more friendly 500 error instead of crashing out with a null reference and letting the connection hang
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 598e5d1..36c6c75 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -1510,11 +1510,25 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1510 | 1510 | ||
1511 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) | 1511 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) |
1512 | { | 1512 | { |
1513 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | 1513 | int responsecode; |
1514 | int responsecode = (int)responsedata["int_response_code"]; | 1514 | string responseString; |
1515 | string responseString = (string)responsedata["str_response_string"]; | 1515 | string contentType; |
1516 | string contentType = (string)responsedata["content_type"]; | ||
1517 | 1516 | ||
1517 | if (responsedata == null) | ||
1518 | { | ||
1519 | responsecode = 500; | ||
1520 | responseString = "No response could be obtained"; | ||
1521 | contentType = "text/plain"; | ||
1522 | responsedata = new Hashtable(); | ||
1523 | } | ||
1524 | else | ||
1525 | { | ||
1526 | |||
1527 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | ||
1528 | responsecode = (int)responsedata["int_response_code"]; | ||
1529 | responseString = (string)responsedata["str_response_string"]; | ||
1530 | contentType = (string)responsedata["content_type"]; | ||
1531 | } | ||
1518 | 1532 | ||
1519 | if (responsedata.ContainsKey("error_status_text")) | 1533 | if (responsedata.ContainsKey("error_status_text")) |
1520 | { | 1534 | { |