bug-serveez
[Top][All Lists]
Advanced

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

Re: [bug-serveez] Preserving object props on sockets


From: Thien-Thi Nguyen
Subject: Re: [bug-serveez] Preserving object props on sockets
Date: Mon, 25 Mar 2013 21:44:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

() Mike Gran <address@hidden>
() Mon, 25 Mar 2013 07:56:16 -0700 (PDT)

   I did try it yesterday.  It segfaults for me.

It turns out, .data is actually for internal use, NOT for user data.
In src/libserveez/socket.h, we see:

  /* Miscellaneous field.  Listener keeps array of server instances here.
     This array is NULL terminated.  */
  void *data;

which should be ‘s/Miscellaneous/Internal/’.  See ‘svz_sock_add_server’
in binding.c, where this field is set to an array.  Really, the field
should be renamed "bindings" and/or moved elsewhere.

I think (w/ only the comment for .{recv,send}_codec "Yet another
extension" as support, rather than actual evidence) that ‘struct
svz_socket’ grew organically; at some early point .data was indeed
opaque (reserved for user), but somehow the bindings code started using
it but that change was not reflected back into the guile layer (which
retains this bolted-on feeling, IMHO).

   I started debugging that a tiny bit.  svz:sock:data returns an
   unknown type that, to the Guile print mechanism, looks like a struct
   with no vtable. I didn't get much farther than that.

   I might take a look at it again later.

I suppose another solution is to use some other properly internal place
to hold that array of server instances, once again allowing .data to be
opaque.  That might even be easy, as well as the right thing, to do...

BTW, commit 2278e641098 (2001-12-15) is the beginning of the overloading
of .data; lots of water under the bridge.

-- 
Thien-Thi Nguyen
GPG key: 4C807502



reply via email to

[Prev in Thread] Current Thread [Next in Thread]