diff options
author | dahlia | 2009-12-02 04:10:53 -0800 |
---|---|---|
committer | dahlia | 2009-12-02 04:10:53 -0800 |
commit | 4234c64147cd59c284276a5408702c31860a5928 (patch) | |
tree | 9ec2bcace50852d7ab70f5fb81e0fdc148209f31 /OpenSim/Framework | |
parent | Change default destination of deleted items to the trash folder. Everything (diff) | |
download | opensim-SC-4234c64147cd59c284276a5408702c31860a5928.zip opensim-SC-4234c64147cd59c284276a5408702c31860a5928.tar.gz opensim-SC-4234c64147cd59c284276a5408702c31860a5928.tar.bz2 opensim-SC-4234c64147cd59c284276a5408702c31860a5928.tar.xz |
handle a condition where the http headers apparently have multiple remote ports designated
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs | 10 |
1 files changed, 9 insertions, 1 deletions
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) |