Re: ORBit2: patch for problem marshalling boolean/char/octet arrays



Hello again,

sorry, this patch just works if the array is the only
element or the last element in a structure.
Setting the data-pointer to the end of marshalled data
was missing. See attached patchfile again.

best regards,
   Michael Haubenwallner

Michael Haubenwallner wrote:
> Hello!
> 
> When upgrading from ORBit to ORBit2 i got problems with char-arrays.
> The communication between client and server with char-arrays did
> never work using ORBit2, but did with ORBit.
> 
> After searching around i found this thread from April, 2002
> http://mail.gnome.org/archives/orbit-list/2002-April/msg00028.html
> with a patch to fix my problem.
> 
> But this patch did not resolve the original problem by just doing
> aligning for boolean/chars/octets too, as Mark McLoughlin mentioned.
> 
> As i find the same problem with ORBit2-2.7.0, here is the patch for
> the real problem with the second argument of giop_send_buffer_append().
> 
> Thx,
>   Michael Haubenwallner
> 
> 
> ------------------------------------------------------------------------
> 
> diff -ru ORBit2-2.3.107.orig/src/orb/orb-core/corba-any.c ORBit2-2.3.107-sa1/src/orb/orb-core/corba-any.c
> --- ORBit2-2.3.107.orig/src/orb/orb-core/corba-any.c	Mon Feb 11 09:57:18 2002
> +++ ORBit2-2.3.107/src/orb/orb-core/corba-any.c	Thu Mar 27 17:58:39 2003
> @@ -233,7 +233,7 @@
>  		case CORBA_tk_boolean:
>  		case CORBA_tk_char:
>  		case CORBA_tk_octet:
> -			giop_send_buffer_append (buf, val, tc->length);
> +			giop_send_buffer_append (buf, *val, tc->length);
>  			break;
>  		default: {
>  			int align = tc->subtypes[0]->c_align;


-- 
Michael Haubenwallner                    SALOMON Automation GmbH
Forschung & Entwicklung                  A-8114 Friesach bei Graz
mailto:michael.haubenwallner@salomon.at  http://www.salomon.at
diff -ru ORBit2-2.3.107/src/orb/orb-core/corba-any.c ORBit2/src/orb/orb-core/corba-any.c
--- ORBit2-2.3.107/src/orb/orb-core/corba-any.c	Mon Feb 11 09:57:18 2002
+++ ORBit2/src/orb/orb-core/corba-any.c	Fri Mar 28 09:56:21 2003
@@ -233,7 +233,8 @@
 		case CORBA_tk_boolean:
 		case CORBA_tk_char:
 		case CORBA_tk_octet:
-			giop_send_buffer_append (buf, val, tc->length);
+			giop_send_buffer_append (buf, *val, tc->length);
+			*val = ((guchar *)*val) + tc->length;
 			break;
 		default: {
 			int align = tc->subtypes[0]->c_align;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]