aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/WebUtil.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r--OpenSim/Framework/WebUtil.cs28
1 files changed, 20 insertions, 8 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index a03d626..b85d93d 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -733,7 +733,8 @@ namespace OpenSim.Framework
733 reqnum, verb, requestUrl); 733 reqnum, verb, requestUrl);
734 734
735 int tickstart = Util.EnvironmentTickCount(); 735 int tickstart = Util.EnvironmentTickCount();
736 int tickdata = 0; 736// int tickdata = 0;
737 int tickdiff = 0;
737 738
738 Type type = typeof(TRequest); 739 Type type = typeof(TRequest);
739 740
@@ -776,8 +777,8 @@ namespace OpenSim.Framework
776 requestStream.Close(); 777 requestStream.Close();
777 778
778 // capture how much time was spent writing 779 // capture how much time was spent writing
779 tickdata = Util.EnvironmentTickCountSubtract(tickstart); 780 // useless in this async
780 781// tickdata = Util.EnvironmentTickCountSubtract(tickstart);
781 request.BeginGetResponse(delegate(IAsyncResult ar) 782 request.BeginGetResponse(delegate(IAsyncResult ar)
782 { 783 {
783 response = request.EndGetResponse(ar); 784 response = request.EndGetResponse(ar);
@@ -794,7 +795,8 @@ namespace OpenSim.Framework
794 finally 795 finally
795 { 796 {
796 // Let's not close this 797 // Let's not close this
797 //buffer.Close(); 798 // yes do close it
799 buffer.Close();
798 respStream.Close(); 800 respStream.Close();
799 response.Close(); 801 response.Close();
800 } 802 }
@@ -862,7 +864,6 @@ namespace OpenSim.Framework
862 } 864 }
863 865
864 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); 866 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
865
866 try 867 try
867 { 868 {
868 action(deserial); 869 action(deserial);
@@ -877,9 +878,10 @@ namespace OpenSim.Framework
877 }, null); 878 }, null);
878 } 879 }
879 880
880 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); 881 tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
881 if (tickdiff > WebUtil.LongCallTime) 882 if (tickdiff > WebUtil.LongCallTime)
882 { 883 {
884/*
883 string originalRequest = null; 885 string originalRequest = null;
884 886
885 if (buffer != null) 887 if (buffer != null)
@@ -898,12 +900,19 @@ namespace OpenSim.Framework
898 tickdiff, 900 tickdiff,
899 tickdata, 901 tickdata,
900 originalRequest); 902 originalRequest);
903*/
904 m_log.InfoFormat(
905 "[ASYNC REQUEST]: Slow WebRequest SETUP <{0}> {1} {2} took {3}ms",
906 reqnum,
907 verb,
908 requestUrl,
909 tickdiff);
901 } 910 }
902 else if (WebUtil.DebugLevel >= 4) 911 else if (WebUtil.DebugLevel >= 4)
903 { 912 {
904 m_log.DebugFormat( 913 m_log.DebugFormat(
905 "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", 914 "[WEB UTIL]: HTTP OUT {0} took {1}ms",
906 reqnum, tickdiff, tickdata); 915 reqnum, tickdiff);
907 } 916 }
908 } 917 }
909 } 918 }
@@ -938,6 +947,8 @@ namespace OpenSim.Framework
938 request.Method = verb; 947 request.Method = verb;
939 string respstring = String.Empty; 948 string respstring = String.Empty;
940 949
950 int tickset = Util.EnvironmentTickCountSubtract(tickstart);
951
941 using (MemoryStream buffer = new MemoryStream()) 952 using (MemoryStream buffer = new MemoryStream())
942 { 953 {
943 if ((verb == "POST") || (verb == "PUT")) 954 if ((verb == "POST") || (verb == "PUT"))
@@ -1019,6 +1030,7 @@ namespace OpenSim.Framework
1019 verb, 1030 verb,
1020 requestUrl, 1031 requestUrl,
1021 tickdiff, 1032 tickdiff,
1033 tickset,
1022 tickdata, 1034 tickdata,
1023 obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); 1035 obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj);
1024 else if (WebUtil.DebugLevel >= 4) 1036 else if (WebUtil.DebugLevel >= 4)