Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-07 19:09:46 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-07 19:09:46 +0400
commit0e2463e1d32b48de18d016ca4d677c44dabb5b62 (patch)
tree038e101f51b8f7742f0e96c5665103c47c5d2801 /mcs/class/System/Test
parent547e70a03bea8ecc879f1544deac0e30045102e1 (diff)
2009-07-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
* WebClientTest.cs: if we write the 100 response, reset the output stream writer. svn path=/trunk/mcs/; revision=137500
Diffstat (limited to 'mcs/class/System/Test')
-rw-r--r--mcs/class/System/Test/System.Net/ChangeLog5
-rw-r--r--mcs/class/System/Test/System.Net/WebClientTest.cs19
2 files changed, 13 insertions, 11 deletions
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 <gonzalo@novell.com>
+
+ * WebClientTest.cs: if we write the 100 response, reset the output
+ stream writer.
+
2009-07-06 Gert Driesen <drieseng@users.sourceforge.net>
* 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));