Re: orbit-perl patch



The put_objref() code in marshal.c has changed in CVS
since your 0.4.3.

Having said that, reviewing the code,
it is not comforting to see the comment
still in there.

I think that the check against the typecode
should be removed since we already know we are
marshalling an object reference.

CORBA's C language binding does not need or have
a narrow() function, although it does have is_a().
However checking with is_a() is something that
will be performed by the object reference's servant's
ORB if/when an operation is ever invoked using the
reference being marshalled. Also is_a()
involves a remote call to the reference's
servant's ORB if the reference is not for a local
servant and the local ORB cannot match up the
repository IDs; that can happen in several
circumstances, not least if a remote ORB
is running it's own special derived
interface of some base, where the local
ORB is only aware of the base and won't
recognise the derived's repository ID.

I note that neither omniORB nor ORBit itself attempt
to validate the repository ID of the IDL parameter
against the repository ID actually passed in or
out by clients/servants when marshalling
object references. Receiver beware seems to
be the approach.

The entire put_objref() function should
probably be simplified to:

static CORBA_boolean
put_objref (GIOPSendBuffer *buf, CORBA_TypeCode tc, SV *sv)
{
  CORBA_Object obj;

  if (!SvOK(sv))
    obj = CORBA_OBJECT_NIL;
  else {
    if (!sv_derived_from(sv, "CORBA::Object")) {
      warn("not an object reference");
      return CORBA_FALSE;
    }

    obj = (CORBA_Object)SvIV((SV *)SvRV(sv));
  }

  ORBit_marshal_object(buf, obj);
  return CORBA_TRUE;
}

Anyway, can you test with the latest CVS version please?

cvs -d :pserver:anonymous anoncvs gnome org:/cvs/gnome login
(hit return when prompted for password)
cvs -d :pserver:anonymous anoncvs gnome org:/cvs/gnome checkout
orbit-perl

Thanks,

	-Huw

Sreeji K Das wrote:
> 
> Hi
> I had sent the above patch to this list long back. The following code
> snippet fails.
> 
> ....
> ..
> $Server = CreateServer();
> $NameComponent =
> {
>   'id'   => 'DepositServer',
>   'kind' => 'Accounting',
> };
> 
> $NameServer = Object2Ref($IOR_of_Name_Server);
> $NameServer->bind([$NameComponent], $Server);
> ..
> ..
> 
> The bind() call fails, due to a wrong checking of $Server. As a result,
> you cannot register an object with the Naming Service from perl. The
> attached patch fixes the problem. I had posted a test script to demo. the
> problem. If needed I can search & find it out.
> 
> BTW, as I see it, there is not much devel. taking place with
> CORBA::ORBit. Owen, any plans for a latest release ? Is ORBit2 ripe enough
> to create perl bindings ?
> 
> Sreeji



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