diff options
author | Justin Clark-Casey (justincc) | 2010-09-04 01:38:11 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-09-04 01:38:11 +0100 |
commit | c0b16f09bfc4f0c2aeabb7c6315f1124f8b08974 (patch) | |
tree | 9e0db9a67ff4b8c9a8c1d938f6407bcee0f7cb42 /OpenSim/Framework/Util.cs | |
parent | Move code that allows llGiveInvetory() to move item into appropriate system f... (diff) | |
parent | Added XFF header processing. Untested, for lack of proxy. (diff) | |
download | opensim-SC_OLD-c0b16f09bfc4f0c2aeabb7c6315f1124f8b08974.zip opensim-SC_OLD-c0b16f09bfc4f0c2aeabb7c6315f1124f8b08974.tar.gz opensim-SC_OLD-c0b16f09bfc4f0c2aeabb7c6315f1124f8b08974.tar.bz2 opensim-SC_OLD-c0b16f09bfc4f0c2aeabb7c6315f1124f8b08974.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index b5d025f..2ac4eb1 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1495,5 +1495,33 @@ namespace OpenSim.Framework | |||
1495 | } | 1495 | } |
1496 | } | 1496 | } |
1497 | 1497 | ||
1498 | /// <summary> | ||
1499 | /// Gets the client IP address | ||
1500 | /// </summary> | ||
1501 | /// <param name="xff"></param> | ||
1502 | /// <returns></returns> | ||
1503 | public static IPEndPoint GetClientIPFromXFF(string xff) | ||
1504 | { | ||
1505 | if (xff == string.Empty) | ||
1506 | return null; | ||
1507 | |||
1508 | string[] parts = xff.Split(new char[] { ',' }); | ||
1509 | if (parts.Length > 0) | ||
1510 | { | ||
1511 | try | ||
1512 | { | ||
1513 | return new IPEndPoint(IPAddress.Parse(parts[0]), 0); | ||
1514 | } | ||
1515 | catch (Exception e) | ||
1516 | { | ||
1517 | m_log.WarnFormat("[UTIL]: Exception parsing XFF header {0}: {1}", xff, e.Message); | ||
1518 | } | ||
1519 | } | ||
1520 | |||
1521 | return null; | ||
1522 | } | ||
1523 | |||
1524 | |||
1525 | |||
1498 | } | 1526 | } |
1499 | } | 1527 | } |