You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/07/12 21:10:17 UTC
svn commit: r421376 - in /incubator/activemq/trunk/activemq-dotnet:
activemq-dotnet.csproj
src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
Author: chirino
Date: Wed Jul 12 12:10:16 2006
New Revision: 421376
URL: http://svn.apache.org/viewvc?rev=421376&view=rev
Log:
Patch applied: http://issues.apache.org/activemq/browse/AMQ-719
Thanks Jamie!
Modified:
incubator/activemq/trunk/activemq-dotnet/activemq-dotnet.csproj
incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
Modified: incubator/activemq/trunk/activemq-dotnet/activemq-dotnet.csproj
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-dotnet/activemq-dotnet.csproj?rev=421376&r1=421375&r2=421376&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/activemq-dotnet.csproj (original)
+++ incubator/activemq/trunk/activemq-dotnet/activemq-dotnet.csproj Wed Jul 12 12:10:16 2006
@@ -1,16 +1,4 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{08321F42-4B3D-4815-B592-95962BAC3B9F}</ProjectGuid>
- <OutputType>Library</OutputType>
- <RootNamespace>activemq-dotnet</RootNamespace>
- <AssemblyName>activemq-dotnet</AssemblyName>
- <WarningLevel>4</WarningLevel>
- <StartupObject/>
- </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
@@ -26,6 +14,18 @@
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{08321F42-4B3D-4815-B592-95962BAC3B9F}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>activemq-dotnet</RootNamespace>
+ <AssemblyName>activemq-dotnet</AssemblyName>
+ <WarningLevel>4</WarningLevel>
+ <StartupObject/>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework"/>
<Reference Include="System"/>
@@ -54,9 +54,11 @@
<Compile Include="src\main\csharp\ActiveMQ\Commands\BrokerId.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\BrokerInfo.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\Command.cs"/>
+ <Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionControl.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionError.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionId.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionInfo.cs"/>
+ <Compile Include="src\main\csharp\ActiveMQ\Commands\ConsumerControl.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\ConsumerId.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\ConsumerInfo.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\Commands\ControlCommand.cs"/>
@@ -132,9 +134,11 @@
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\BaseCommandMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\BrokerIdMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\BrokerInfoMarshaller.cs"/>
+ <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionControlMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionErrorMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionIdMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionInfoMarshaller.cs"/>
+ <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConsumerControlMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConsumerIdMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConsumerInfoMarshaller.cs"/>
<Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ControlCommandMarshaller.cs"/>
Modified: incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs?rev=421376&r1=421375&r2=421376&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs (original)
+++ incubator/activemq/trunk/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs Wed Jul 12 12:10:16 2006
@@ -54,15 +54,14 @@
if (text == null)
{
// now lets read the content
-
byte[] data = this.Content;
if (data != null)
{
// TODO assume that the text is ASCII
- char[] chars = new char[data.Length];
+ char[] chars = new char[data.Length-sizeof(int)];
for (int i = 0; i < chars.Length; i++)
{
- chars[i] = (char) data[i];
+ chars[i] = (char) data[i+sizeof(int)];
}
text = new String(chars);
}
@@ -75,17 +74,31 @@
byte[] data = null;
if (text != null)
{
- // TODO assume that the text is ASCII
- data = new byte[text.Length];
-
- // now lets write the bytes
+ // TODO assume that the text is ASCII
+
+ byte[] sizePrefix = System.BitConverter.GetBytes(text.Length);
+ data = new byte[text.Length + sizePrefix.Length]; //int at the front of it
+
+ // add the size prefix
+ for (int j = 0; j < sizePrefix.Length; j++)
+ {
+ // The bytes need to be encoded in big endian
+ if ( BitConverter.IsLittleEndian ) {
+ data[j] = sizePrefix[sizePrefix.Length - j - 1];
+ } else {
+ data[j] = sizePrefix[j];
+ }
+ }
+
+ // Add the data.
char[] chars = text.ToCharArray();
- for (int i = 0; i < chars.Length; i++)
+ for (int i = 0; i < chars.Length; i++)
{
- data[i] = (byte) chars[i];
+ data[i + sizePrefix.Length] = (byte)chars[i];
}
- }
- this.Content = data;
+ }
+ this.Content = data;
+
}
}
}