From 6f38ec3919dbaf7a2757dbe3a88eee254940c1f2 Mon Sep 17 00:00:00 2001 From: zoltan Date: Sat, 23 Aug 2008 01:43:05 +0000 Subject: [PATCH] 2008-08-23 Zoltan Varga * WebConnectionStream.cs (WriteRequest): Fix the copying in the previous patch, when bytes.Length != length. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@111456 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/System/System.Net/ChangeLog | 5 +++++ class/System/System.Net/WebConnectionStream.cs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/class/System/System.Net/ChangeLog b/class/System/System.Net/ChangeLog index 6c420c48f8..2f0d20a763 100644 --- a/class/System/System.Net/ChangeLog +++ b/class/System/System.Net/ChangeLog @@ -1,3 +1,8 @@ +2008-08-23 Zoltan Varga + + * WebConnectionStream.cs (WriteRequest): Fix the copying in the + previous patch, when bytes.Length != length. + 2008-08-22 Zoltan Varga * WebConnectionStream.cs (WriteRequest): For small requests, diff --git a/class/System/System.Net/WebConnectionStream.cs b/class/System/System.Net/WebConnectionStream.cs index bf46502687..2e53437b3f 100644 --- a/class/System/System.Net/WebConnectionStream.cs +++ b/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); -- 2.11.4.GIT