Browse Source

2005-03-30 Atsushi Enomoto <[email protected]>

	* XmlUrlResolver.cs : just return connected Stream instead of fully
	  downloaded memory cache. Fix by Konstantin Triger.


svn path=/trunk/mcs/; revision=42361
Atsushi Eno 21 years ago
parent
commit
eff521817b

+ 5 - 0
mcs/class/System.XML/System.Xml/ChangeLog

@@ -1,3 +1,8 @@
+2005-03-30  Atsushi Enomoto <[email protected]>
+
+	* XmlUrlResolver.cs : just return connected Stream instead of fully
+	  downloaded memory cache. Fix by Konstantin Triger.
+
 2005-03-24  Atsushi Enomoto <[email protected]>
 
 	* XmlWriter.cs : WriteQualifiedName() should check namespace validity

+ 5 - 8
mcs/class/System.XML/System.Xml/XmlUrlResolver.cs

@@ -65,14 +65,11 @@ namespace System.Xml
 			}
 
 			// (MS documentation says) parameter role isn't used yet.
-			Stream s = null;
-			using (s) {
-				WebClient wc = new WebClient ();
-				wc.Credentials = credential;
-				byte [] data = wc.DownloadData (absoluteUri.ToString ());
-				wc.Dispose ();
-				return new MemoryStream (data, 0, data.Length);
-			}
+			WebRequest req = WebRequest.Create (absoluteUri);
+			if (credential != null)
+				req.Credentials = credential;
+			return req.GetResponse().GetResponseStream();
+
 		}
 
 		// see also XmlResolver.EscapeRelativeUriBody().