Merge pull request #3562 from BrzVlad/fix-reverse-wbarrier
[mono.git] / mcs / class / System.Web / System.Web / HttpRequest.cs
index d273f1cf1fdb7d7c3afa0de5240527a8ec6cae8c..8e9359a9f896d82618f25239529e50c3a0f90087 100755 (executable)
@@ -39,6 +39,7 @@ using System.Runtime.InteropServices;
 using System.Security;
 using System.Security.Permissions;
 using System.Security.Principal;
+using System.Threading;
 using System.Web.Configuration;
 using System.Web.Management;
 using System.Web.UI;
@@ -980,6 +981,11 @@ namespace System.Web
                        }
                }
 
+               public Stream GetBufferedInputStream ()
+               {
+                       return input_stream;
+               }
+
                public Stream GetBufferlessInputStream ()
                {
                        if (bufferlessInputStream == null) {
@@ -993,6 +999,11 @@ namespace System.Web
                        return bufferlessInputStream;
                }
 
+               public Stream GetBufferlessInputStream (bool disableMaxRequestLength)
+               {
+                       return GetBufferlessInputStream ();
+               }
+
                //
                // Stream that returns the data as it is read, without buffering
                //
@@ -1399,6 +1410,12 @@ namespace System.Web
                        }
                }
 
+               public CancellationToken TimedOutToken {
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
                public int TotalBytes {
                        get {
                                Stream ins = InputStream;
@@ -1508,6 +1525,38 @@ namespace System.Web
                }
 
                public int [] MapImageCoordinates (string imageFieldName)
+               {
+                       string[] parameters = GetImageCoordinatesParameters (imageFieldName);
+                       if (parameters == null)
+                               return null;
+                       int [] result = new int [2];
+                       try {
+                               result [0] = Int32.Parse (parameters [0]);
+                               result [1] = Int32.Parse (parameters [1]);
+                       } catch {
+                               return null;
+                       }
+
+                       return result;
+               }
+
+               public double [] MapRawImageCoordinates (string imageFieldName)
+               {
+                       string[] parameters = GetImageCoordinatesParameters (imageFieldName);
+                       if (parameters == null)
+                               return null;
+                       double [] result = new double [2];
+                       try {
+                               result [0] = Double.Parse (parameters [0]);
+                               result [1] = Double.Parse (parameters [1]);
+                       } catch {
+                               return null;
+                       }
+
+                       return result;
+               }
+
+               string [] GetImageCoordinatesParameters (string imageFieldName)
                {
                        string method = HttpMethod;
                        NameValueCollection coll = null;
@@ -1526,14 +1575,7 @@ namespace System.Web
                        string y = coll [imageFieldName + ".y"];
                        if (y == null || y == "")
                                return null;
-
-                       int [] result = new int [2];
-                       try {
-                               result [0] = Int32.Parse (x);
-                               result [1] = Int32.Parse (y);
-                       } catch {
-                               return null;
-                       }
+                       string[] result = new string [] { x, y };
 
                        return result;
                }