From 0e2463e1d32b48de18d016ca4d677c44dabb5b62 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Tue, 7 Jul 2009 15:09:46 +0000 Subject: 2009-07-07 Gonzalo Paniagua Javier * WebClientTest.cs: if we write the 100 response, reset the output stream writer. svn path=/trunk/mcs/; revision=137500 --- mcs/class/System/Test/System.Net/ChangeLog | 5 +++++ mcs/class/System/Test/System.Net/WebClientTest.cs | 19 ++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'mcs/class/System/Test') diff --git a/mcs/class/System/Test/System.Net/ChangeLog b/mcs/class/System/Test/System.Net/ChangeLog index 7017382e720..a994f35635a 100644 --- a/mcs/class/System/Test/System.Net/ChangeLog +++ b/mcs/class/System/Test/System.Net/ChangeLog @@ -1,3 +1,8 @@ +2009-07-07 Gonzalo Paniagua Javier + + * WebClientTest.cs: if we write the 100 response, reset the output + stream writer. + 2009-07-06 Gert Driesen * HttpWebRequestTest.cs: Enabled tests, and removed test that is now diff --git a/mcs/class/System/Test/System.Net/WebClientTest.cs b/mcs/class/System/Test/System.Net/WebClientTest.cs index ae0f22a6386..ea87f0aa38b 100644 --- a/mcs/class/System/Test/System.Net/WebClientTest.cs +++ b/mcs/class/System/Test/System.Net/WebClientTest.cs @@ -2058,22 +2058,17 @@ namespace MonoTests.System.Net string expect = null; StreamReader sr = new StreamReader (ms, Encoding.UTF8); - string line = sr.ReadLine (); + string line = null; byte state = 0; - while (line != null) { + while ((line = sr.ReadLine ()) != null) { if (state > 0) { state = 2; sb.Append (line); sb.Append ("\r\n"); - line = sr.ReadLine (); - } else { - if (line.StartsWith ("Expect:")) - expect = line.Substring (8); - line = sr.ReadLine (); - if (line.Length == 0) { - state = 1; - line = sr.ReadLine (); - } + } if (line.Length == 0) { + state = 1; + } else if (line.StartsWith ("Expect:")) { + expect = line.Substring (8); } } @@ -2092,6 +2087,7 @@ namespace MonoTests.System.Net bytesReceived = socket.Receive (buffer); while (bytesReceived > 0) { ms.Write (buffer, 0, bytesReceived); + Thread.Sleep (200); if (socket.Available > 0) { bytesReceived = socket.Receive (buffer); } else { @@ -2111,6 +2107,7 @@ namespace MonoTests.System.Net } } + sw = new StringWriter (); sw.WriteLine ("HTTP/1.1 200 OK"); sw.WriteLine ("Content-Type: text/xml"); sw.WriteLine ("Content-Length: " + sb.Length.ToString (CultureInfo.InvariantCulture)); -- cgit v1.2.3