Author: jbevain
Date: 2007-11-07 05:02:45 -0500 (Wed, 07 Nov 2007)
New Revision: 89080

Modified:
   
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebRequest.cs
   
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebResponse.cs
   trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/ChangeLog
Log:
2007-11-07  Jb Evain  <[EMAIL PROTECTED]>

        * BrowserHttpWebResponse.cs: implement status.



Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebRequest.cs
===================================================================
--- 
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebRequest.cs
    2007-11-07 10:01:54 UTC (rev 89079)
+++ 
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebRequest.cs
    2007-11-07 10:02:45 UTC (rev 89080)
@@ -117,7 +117,6 @@
                        headers [HttpRequestHeader.Range] = range;
                }
 
-               [MonoTODO]
                public override IAsyncResult BeginGetRequestStream 
(AsyncCallback callback, object state)
                {
                        throw new NotImplementedException ();
@@ -129,7 +128,6 @@
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public override Stream EndGetRequestStream (IAsyncResult 
asyncResult)
                {
                        throw new NotImplementedException ();

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebResponse.cs
===================================================================
--- 
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebResponse.cs
   2007-11-07 10:01:54 UTC (rev 89079)
+++ 
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/BrowserHttpWebResponse.cs
   2007-11-07 10:02:45 UTC (rev 89080)
@@ -42,6 +42,9 @@
                IntPtr native;
                Stream response;
 
+               HttpStatusCode status_code;
+               string status_desc;
+
                WebHeaderCollection headers = new WebHeaderCollection ();
 
                public BrowserHttpWebResponse (IntPtr native)
@@ -74,8 +77,8 @@
 
                internal void Read ()
                {
-                       int size = 0;
-                       IntPtr p = NativeMethods.browser_http_response_read 
(native, ref size);
+                       int size;
+                       IntPtr p = NativeMethods.browser_http_response_read 
(native, out size);
 
                        byte [] data = new byte [size];
                        unsafe {
@@ -148,14 +151,31 @@
                        get { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
+               void GetStatus ()
+               {
+                       if (native == IntPtr.Zero)
+                               return;
+
+                       if (0 == (int) status_code)
+                               return;
+
+                       int code;
+                       status_desc = 
NativeMethods.browser_http_response_get_status (native, out code);
+                       status_code = (HttpStatusCode) code;
+               }
+
                public override HttpStatusCode StatusCode {
-                       get { throw new NotImplementedException (); }
+                       get {
+                               GetStatus ();
+                               return status_code;
+                       }
                }
 
-               [MonoTODO]
                public override string StatusDescription {
-                       get { throw new NotImplementedException (); }
+                       get {
+                               GetStatus ();
+                               return status_desc;
+                       }
                }
        }
 }

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/ChangeLog
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/ChangeLog   
2007-11-07 10:01:54 UTC (rev 89079)
+++ trunk/olive/class/System.Silverlight/System.Windows.Browser.Net/ChangeLog   
2007-11-07 10:02:45 UTC (rev 89080)
@@ -1,3 +1,7 @@
+2007-11-07  Jb Evain  <[EMAIL PROTECTED]>
+
+       * BrowserHttpWebResponse.cs: implement status.
+
 2007-10-23  Jb Evain  <[EMAIL PROTECTED]>
 
        * BrowserHttpWebRequest.cs: implement Abort

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to