Browse Source

2008-08-23 Zoltan Varga <[email protected]>

	* WebConnectionStream.cs (WriteRequest): Fix the copying in the
	previous patch, when bytes.Length != length.

svn path=/trunk/mcs/; revision=111456
Zoltan Varga 17 years ago
parent
commit
2efbbd2f1d

+ 5 - 0
mcs/class/System/System.Net/ChangeLog

@@ -1,3 +1,8 @@
+2008-08-23  Zoltan Varga  <[email protected]>
+
+	* WebConnectionStream.cs (WriteRequest): Fix the copying in the
+	previous patch, when bytes.Length != length.
+
 2008-08-22  Zoltan Varga  <[email protected]>
 
 	* WebConnectionStream.cs (WriteRequest): For small requests,

+ 2 - 2
mcs/class/System/System.Net/WebConnectionStream.cs

@@ -548,8 +548,8 @@ namespace System.Net
 			if (headers.Length + length < 8192){
 				byte[] b = new byte [headers.Length + length];
 
-				headers.CopyTo (b, 0);
-				bytes.CopyTo (b, headers.Length);
+				Buffer.BlockCopy (headers, 0, b, 0, headers.Length);
+				Buffer.BlockCopy (bytes, 0, b, headers.Length, length);
 				
 				if (!cnc.Write (b, 0, b.Length))
 					throw new WebException ("Error writing request.", null, WebExceptionStatus.SendFailure, null);