[Mono-bugs] [Bug 75526][Nor] Changed - [PATCH] StreamReader blocks on reading too much

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jan 25 02:43:51 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gonzalo at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=75526

--- shadow/75526	2007-01-25 02:29:32.000000000 -0500
+++ shadow/75526.tmp.14769	2007-01-25 02:43:51.000000000 -0500
@@ -1,13 +1,13 @@
 Bug#: 75526
 Product: Mono: Class Libraries
 Version: 1.1
 OS: All
 OS Details: 
-Status: NEW   
-Resolution: 
+Status: RESOLVED   
+Resolution: FIXED
 Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: gnauck at ag-software.de               
 QAContact: mono-bugs at ximian.com
@@ -230,6 +230,38 @@
 There might be a trick to make this thing work: in ReadBuffer() we
 need to set a flag when the number of bytes read is less than the
 number of bytes requested. That means that the next read could be the
 end of the file (or could not, we won't know until we read again).
 
 I'll attach a patch as soon as I test it.
+
+------- Additional Comments From gonzalo at ximian.com  2007-01-25 02:43 -------
+With this patch:
+
+Index: StreamReader.cs
+===================================================================
+--- StreamReader.cs     (revision 71577)
++++ StreamReader.cs     (working copy)
+@@ -379,6 +379,8 @@
+                                index += cch;
+                                count -= cch;
+                                chars_read += cch;
++                               if (mayBlock)
++                                       break;
+                        }
+                        return chars_read;
+                }
+
+--------------
+
+I get:
+gonzalo at lalo-linux:/tmp $ mono miguel.exe 
+Read 8192 bytes
+gonzalo at lalo-linux:/tmp $ mono ben.exe 
+Read
+2
+gonzalo at lalo-linux:/tmp $ 
+
+and all corlib tests pass.
+
+This has been commited in r71650.
+


More information about the mono-bugs mailing list