aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-09-11 21:48:02 +0100
committerJustin Clark-Casey (justincc)2012-09-11 21:48:51 +0100
commit25111e703f54d84c7c51e32db1f94332ea3ffd00 (patch)
treef0fd2496b35cea00b7f737ba61af9f72f22da0f3 /OpenSim/Framework/Util.cs
parentrefactoring to allow Scene.GetLandData to accept Vector3 as an argument. Note... (diff)
downloadopensim-SC_OLD-25111e703f54d84c7c51e32db1f94332ea3ffd00.zip
opensim-SC_OLD-25111e703f54d84c7c51e32db1f94332ea3ffd00.tar.gz
opensim-SC_OLD-25111e703f54d84c7c51e32db1f94332ea3ffd00.tar.bz2
opensim-SC_OLD-25111e703f54d84c7c51e32db1f94332ea3ffd00.tar.xz
Add levels 4 and 5 to "debug http" console command that will log a sample of incoming request data and the entire incoming data respectively.
See "help debug http" for more details.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 38cb3a6..1b9777f 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1007,6 +1007,38 @@ namespace OpenSim.Framework
1007 } 1007 }
1008 } 1008 }
1009 1009
1010 /// <summary>
1011 /// Copy data from one stream to another, leaving the read position of both streams at the beginning.
1012 /// </summary>
1013 /// <param name='inputStream'>
1014 /// Input stream. Must be seekable.
1015 /// </param>
1016 /// <exception cref='ArgumentException'>
1017 /// Thrown if the input stream is not seekable.
1018 /// </exception>
1019 public static Stream Copy(Stream inputStream)
1020 {
1021 if (!inputStream.CanSeek)
1022 throw new ArgumentException("Util.Copy(Stream inputStream) must receive an inputStream that can seek");
1023
1024 const int readSize = 256;
1025 byte[] buffer = new byte[readSize];
1026 MemoryStream ms = new MemoryStream();
1027
1028 int count = inputStream.Read(buffer, 0, readSize);
1029
1030 while (count > 0)
1031 {
1032 ms.Write(buffer, 0, count);
1033 count = inputStream.Read(buffer, 0, readSize);
1034 }
1035
1036 ms.Position = 0;
1037 inputStream.Position = 0;
1038
1039 return ms;
1040 }
1041
1010 public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args) 1042 public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args)
1011 { 1043 {
1012 return SendXmlRpcCommand(url, methodName, args); 1044 return SendXmlRpcCommand(url, methodName, args);