aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2013-06-13 02:49:43 +0100
committerMelanie2013-06-13 02:49:43 +0100
commit9975c5674c002be0e17db02b589c388b684f63a9 (patch)
treeaa727252685987781696db21f9eee58dd6b6d023 /OpenSim/Framework
parentMerge branch 'master' into careminster (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-9975c5674c002be0e17db02b589c388b684f63a9.zip
opensim-SC-9975c5674c002be0e17db02b589c388b684f63a9.tar.gz
opensim-SC-9975c5674c002be0e17db02b589c388b684f63a9.tar.bz2
opensim-SC-9975c5674c002be0e17db02b589c388b684f63a9.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Animation.cs5
-rw-r--r--OpenSim/Framework/Servers/MainServer.cs8
-rw-r--r--OpenSim/Framework/WebUtil.cs54
3 files changed, 59 insertions, 8 deletions
diff --git a/OpenSim/Framework/Animation.cs b/OpenSim/Framework/Animation.cs
index 8bdf8f4..3425505 100644
--- a/OpenSim/Framework/Animation.cs
+++ b/OpenSim/Framework/Animation.cs
@@ -125,11 +125,10 @@ namespace OpenSim.Framework
125 Animation other = obj as Animation; 125 Animation other = obj as Animation;
126 if (other != null) 126 if (other != null)
127 { 127 {
128 return (other.AnimID == this.AnimID 128 return (other.AnimID.Equals(this.AnimID)
129 && other.SequenceNum == this.SequenceNum 129 && other.SequenceNum == this.SequenceNum
130 && other.ObjectID == this.ObjectID); 130 && other.ObjectID.Equals(this.ObjectID) );
131 } 131 }
132
133 return base.Equals(obj); 132 return base.Equals(obj);
134 } 133 }
135 134
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs
index cfd34bb..d189580 100644
--- a/OpenSim/Framework/Servers/MainServer.cs
+++ b/OpenSim/Framework/Servers/MainServer.cs
@@ -121,12 +121,14 @@ namespace OpenSim.Framework.Servers
121 + " level >= 2 then long warnings are logged when receiving bad input data.\n" 121 + " level >= 2 then long warnings are logged when receiving bad input data.\n"
122 + " level >= 3 then short notices about all incoming non-poll HTTP requests are logged.\n" 122 + " level >= 3 then short notices about all incoming non-poll HTTP requests are logged.\n"
123 + " level >= 4 then the time taken to fulfill the request is logged.\n" 123 + " level >= 4 then the time taken to fulfill the request is logged.\n"
124 + " level >= 5 then a sample from the beginning of the incoming data is logged.\n" 124 + " level >= 5 then a sample from the beginning of the data is logged.\n"
125 + " level >= 6 then the entire incoming data is logged.\n" 125 + " level >= 6 then the entire data is logged.\n"
126 + " no level is specified then the current level is returned.\n\n" 126 + " no level is specified then the current level is returned.\n\n"
127 + "If out or all and\n" 127 + "If out or all and\n"
128 + " level >= 3 then short notices about all outgoing requests going through WebUtil are logged.\n" 128 + " level >= 3 then short notices about all outgoing requests going through WebUtil are logged.\n"
129 + " level >= 4 then the time taken to fulfill the request is logged.\n", 129 + " level >= 4 then the time taken to fulfill the request is logged.\n"
130 + " level >= 5 then a sample from the beginning of the data is logged.\n"
131 + " level >= 6 then the entire data is logged.\n",
130 HandleDebugHttpCommand); 132 HandleDebugHttpCommand);
131 } 133 }
132 134
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index bf57fd4..312e9a9 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -151,6 +151,39 @@ namespace OpenSim.Framework
151 } 151 }
152 } 152 }
153 153
154 public static void LogOutgoingDetail(Stream outputStream)
155 {
156 using (StreamReader reader = new StreamReader(Util.Copy(outputStream), Encoding.UTF8))
157 {
158 string output;
159
160 if (DebugLevel == 5)
161 {
162 const int sampleLength = 80;
163 char[] sampleChars = new char[sampleLength];
164 reader.Read(sampleChars, 0, sampleLength);
165 output = new string(sampleChars);
166 }
167 else
168 {
169 output = reader.ReadToEnd();
170 }
171
172 LogOutgoingDetail(output);
173 }
174 }
175
176 public static void LogOutgoingDetail(string output)
177 {
178 if (DebugLevel == 5)
179 {
180 output = output.Substring(0, 80);
181 output = output + "...";
182 }
183
184 m_log.DebugFormat("[WEB UTIL]: {0}", output.Replace("\n", @"\n"));
185 }
186
154 private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed) 187 private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed)
155 { 188 {
156 int reqnum = RequestNumber++; 189 int reqnum = RequestNumber++;
@@ -178,7 +211,11 @@ namespace OpenSim.Framework
178 // If there is some input, write it into the request 211 // If there is some input, write it into the request
179 if (data != null) 212 if (data != null)
180 { 213 {
181 strBuffer = OSDParser.SerializeJsonString(data); 214 strBuffer = OSDParser.SerializeJsonString(data);
215
216 if (DebugLevel >= 5)
217 LogOutgoingDetail(strBuffer);
218
182 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); 219 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer);
183 220
184 if (compressed) 221 if (compressed)
@@ -358,6 +395,10 @@ namespace OpenSim.Framework
358 if (data != null) 395 if (data != null)
359 { 396 {
360 queryString = BuildQueryString(data); 397 queryString = BuildQueryString(data);
398
399 if (DebugLevel >= 5)
400 LogOutgoingDetail(queryString);
401
361 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString); 402 byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString);
362 403
363 request.ContentLength = buffer.Length; 404 request.ContentLength = buffer.Length;
@@ -769,6 +810,9 @@ namespace OpenSim.Framework
769 int length = (int)buffer.Length; 810 int length = (int)buffer.Length;
770 request.ContentLength = length; 811 request.ContentLength = length;
771 812
813 if (WebUtil.DebugLevel >= 5)
814 WebUtil.LogOutgoingDetail(buffer);
815
772 request.BeginGetRequestStream(delegate(IAsyncResult res) 816 request.BeginGetRequestStream(delegate(IAsyncResult res)
773 { 817 {
774 Stream requestStream = request.EndGetRequestStream(res); 818 Stream requestStream = request.EndGetRequestStream(res);
@@ -966,6 +1010,9 @@ namespace OpenSim.Framework
966 length = (int)obj.Length; 1010 length = (int)obj.Length;
967 request.ContentLength = length; 1011 request.ContentLength = length;
968 1012
1013 if (WebUtil.DebugLevel >= 5)
1014 WebUtil.LogOutgoingDetail(buffer);
1015
969 Stream requestStream = null; 1016 Stream requestStream = null;
970 try 1017 try
971 { 1018 {
@@ -1111,6 +1158,9 @@ namespace OpenSim.Framework
1111 int length = (int)buffer.Length; 1158 int length = (int)buffer.Length;
1112 request.ContentLength = length; 1159 request.ContentLength = length;
1113 1160
1161 if (WebUtil.DebugLevel >= 5)
1162 WebUtil.LogOutgoingDetail(buffer);
1163
1114 Stream requestStream = null; 1164 Stream requestStream = null;
1115 try 1165 try
1116 { 1166 {
@@ -1213,4 +1263,4 @@ namespace OpenSim.Framework
1213 return deserial; 1263 return deserial;
1214 } 1264 }
1215 } 1265 }
1216} 1266} \ No newline at end of file