diff options
author | Melanie | 2009-12-05 19:53:54 +0000 |
---|---|---|
committer | Melanie | 2009-12-05 19:53:54 +0000 |
commit | 43a6fa1d01707fda74b8ba7c2d9fb95210463b6a (patch) | |
tree | 77c5897901544e82467b1cdfafdc63644ee821ef /OpenSim/Framework | |
parent | Merge branch 'master' into careminster (diff) | |
parent | * Fix line endings in BaseHttpServer.cs (diff) | |
download | opensim-SC-43a6fa1d01707fda74b8ba7c2d9fb95210463b6a.zip opensim-SC-43a6fa1d01707fda74b8ba7c2d9fb95210463b6a.tar.gz opensim-SC-43a6fa1d01707fda74b8ba7c2d9fb95210463b6a.tar.bz2 opensim-SC-43a6fa1d01707fda74b8ba7c2d9fb95210463b6a.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 12 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs | 10 |
2 files changed, 19 insertions, 3 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index bec5ed3..75cdeb4 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -724,12 +724,20 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
724 | } | 724 | } |
725 | catch(Exception e) | 725 | catch(Exception e) |
726 | { | 726 | { |
727 | string errorMessage | ||
728 | = String.Format( | ||
729 | "Requested method [{0}] from {1} threw exception: {2} {3}", | ||
730 | methodName, request.RemoteIPEndPoint.Address, e.Message, e.StackTrace); | ||
731 | |||
732 | m_log.ErrorFormat("[BASE HTTP SERVER]: {0}", errorMessage); | ||
733 | |||
727 | // if the registered XmlRpc method threw an exception, we pass a fault-code along | 734 | // if the registered XmlRpc method threw an exception, we pass a fault-code along |
728 | xmlRpcResponse = new XmlRpcResponse(); | 735 | xmlRpcResponse = new XmlRpcResponse(); |
736 | |||
729 | // Code probably set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php | 737 | // Code probably set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php |
730 | xmlRpcResponse.SetFault(-32603, String.Format("Requested method [{0}] threw exception: {1}", | 738 | xmlRpcResponse.SetFault(-32603, errorMessage); |
731 | methodName, e.Message)); | ||
732 | } | 739 | } |
740 | |||
733 | // if the method wasn't found, we can't determine KeepAlive state anyway, so lets do it only here | 741 | // if the method wasn't found, we can't determine KeepAlive state anyway, so lets do it only here |
734 | response.KeepAlive = m_rpcHandlersKeepAlive[methodName]; | 742 | response.KeepAlive = m_rpcHandlersKeepAlive[methodName]; |
735 | } | 743 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs index c53160f..bcfb0a4 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs | |||
@@ -188,7 +188,15 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
188 | try | 188 | try |
189 | { | 189 | { |
190 | IPAddress addr = IPAddress.Parse(req.Headers["remote_addr"]); | 190 | IPAddress addr = IPAddress.Parse(req.Headers["remote_addr"]); |
191 | int port = Int32.Parse(req.Headers["remote_port"]); | 191 | // sometimes req.Headers["remote_port"] returns a comma separated list, so use |
192 | // the first one in the list and log it | ||
193 | string[] strPorts = req.Headers["remote_port"].Split(new char[] { ',' }); | ||
194 | if (strPorts.Length > 1) | ||
195 | { | ||
196 | _log.ErrorFormat("[OSHttpRequest]: format exception on addr/port {0}:{1}, ignoring", | ||
197 | req.Headers["remote_addr"], req.Headers["remote_port"]); | ||
198 | } | ||
199 | int port = Int32.Parse(strPorts[0]); | ||
192 | _remoteIPEndPoint = new IPEndPoint(addr, port); | 200 | _remoteIPEndPoint = new IPEndPoint(addr, port); |
193 | } | 201 | } |
194 | catch (FormatException) | 202 | catch (FormatException) |