[omniORB] Wide string problems talking to Visibroker 4.5

Duncan Grisby dgrisby@uk.research.att.com
Mon, 30 Jul 2001 11:36:57 +0100


On Monday 30 July, Stephen Crawley wrote:

> I just managed to prise the following information out of the VBJ Orb.
> It seems to think that the WString that OmniORB is sending is malformed.

As an experiment, can you try this patch and see if it makes
Visibroker happy?  It makes omniORB incorrectly marshal the wstring
with a terminating NUL. If it works with Visibroker, it proves that
Visibroker is doing the wrong thing.

Beware that this patch breaks omniORB. With this, it won't even talk
to itself, let alone any other compliant ORB, since I only hacked the
sending side.

Cheers,

Duncan.


Index: src/lib/omniORB/orbcore/cs-UTF-16.cc
===================================================================
RCS file: /project/omni/cvsroot/omni/src/lib/omniORB/orbcore/Attic/cs-UTF-16.cc,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 cs-UTF-16.cc
--- src/lib/omniORB/orbcore/cs-UTF-16.cc	2001/07/26 16:37:20	1.1.2.8
+++ src/lib/omniORB/orbcore/cs-UTF-16.cc	2001/07/30 10:32:44
@@ -258,6 +258,7 @@
   // Just to be different, wstring is marshalled without a terminating
   // null. Length is in octets.
   _CORBA_ULong mlen = (len+1) * 2;  // len + 1 for BOM
+  mlen += 2; // *** HACK!  Testing Visibrokenness
   mlen >>= stream;
 
   // Send a suitable BOM so that we can marshal with native endian,
@@ -269,6 +270,7 @@
     _CORBA_UShort tc = 0xfeff; tc >>= stream;
   }
   stream.put_octet_array((const _CORBA_Octet*)us, mlen-2, omni::ALIGN_2);
+  _CORBA_ULong nul = 0; nul >>= stream; // *** HACK!  Testing Visibrokenness
 }
 
 

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --