I didn't use ref_obj in the current patch set. After reading the docs, I'm not convinced that it should be used in the Shuffler. Correct choice?
Probably not. Why do you think so? If you set it to NULL there won't be any ref from the backend to the shuffler object when callbacks are in use. Typically the only case when ref_obj should be NULL is when it's statically allocated.
Btw, you probably can replace this_obj with box.ref_obj, provided this_obj is what it looks like.
I put it in the same struct, and removed the fd there. So that should be about right.
If you say so. Wasn't there some circumstances when other fd's could be passed to the callbacks or something like that?
What springs to mind, is, is using INIT_FD_CALLBACK_BOX in just the INIT section enough? Or should it be repeated at create time?
Yes and no. An already hooked box must not be hooked in again.
Regarding your question "must be first?": Yes, it looks like it must be first since you implicitly convert a pointer to the box to a pointer to Shuffle_struct in e.g. _send_more.
/ Martin Stjernholm, Roxen IS
Previous text:
2004-06-22 02:13: Subject: Re: Drowning in the Shuffler (SEGV)
Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
"New backend" is a bit of an exaggeration imo. Anyway, what's necessary to know about "boxes" is in backend.h. It's really not that complicated since the user doesn't have to bother with the refcounting intricacies besides setting ref_obj (that's the whole idea with them).
I didn't use ref_obj in the current patch set. After reading the docs, I'm not convinced that it should be used in the Shuffler. Correct choice?
I looked briefly at the shuffler code but couldn't figure out the right place to put the box. Should be the same object that holds the fd, but the callbacks were used in some clever way so it wasn't that straighforward, as I remember.
I put it in the same struct, and removed the fd there. So that should be about right.
What springs to mind, is, is using INIT_FD_CALLBACK_BOX in just the INIT section enough? Or should it be repeated at create time? -- Sincerely, srb@cuci.nl Stephen R. van den Berg (AKA BuGless).
How many weeks are there in a light year?
/ Brevbäraren