activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r468470 - /incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireBinaryReader.cs
Date Fri, 27 Oct 2006 17:33:01 GMT
Author: jstrachan
Date: Fri Oct 27 10:33:01 2006
New Revision: 468470

URL: http://svn.apache.org/viewvc?view=rev&rev=468470
Log:
applied patch for AMQ-988 from Rob Lugt - thanks!

Modified:
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireBinaryReader.cs

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireBinaryReader.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireBinaryReader.cs?view=diff&rev=468470&r1=468469&r2=468470
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireBinaryReader.cs
(original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireBinaryReader.cs
Fri Oct 27 10:33:01 2006
@@ -146,10 +146,17 @@
                 StringBuilder str = new StringBuilder(utflen);
                 
                 byte[] bytearr = new byte[utflen];
+                int bytesRead = 0;
+                while (bytesRead < utflen)
+                {
+                    int rc = Read(bytearr, bytesRead, utflen-bytesRead);
+                    if (rc == 0)
+                        throw new IOException("premature end of stream");
+                    bytesRead += rc;
+                }
+
                 int c, char2, char3;
                 int count = 0;
-                
-                Read(bytearr, 0, utflen);
                 
                 while (count < utflen)
                 {



Mime
View raw message