[Openais] privatizing conn_info patch

Steven Dake scd at broked.org
Tue Jan 24 23:35:00 PST 2006


Mark,
Find attached my current work at privatizing conn_info.  The basic idea
is to remove entirely conn_info from main.h and move it into main.c. 
Then service handlers will not have to be aware of how conn_info is
structured.  With this patch, the "ais_ci", or library private data, is
allocated before the lib_init_fn is called based upon the size in
service_handler->private_data_size.  This parameter must be set by the
service handler definition (ie: it must be defined in evt.c).

You will have to do an svn update before working on this patch. 
Currently main.c and clm.c build.  You will have to do "make evt.o" to
get the event service to build.

The private data structure should be moved from evt.h into evt.c and all
private data operations should take place via the following selectors:

extern void *openais_conn_partner_get (void *conn);

extern void *openais_conn_private_data_get (void *conn);

libais_send_response has been renamed:

extern int openais_conn_send_response (void *conn, void *msg, int mlen);

Could you work on getting exec/evt.c to compile?  Use clm.c as an
example of how to use the selectors.  I'll work out the rest of the
services and then we can integrate and test.

If successful, there should be no use of "struct conn_info" or "ais_ci"
in exec/evt.c.

I realize this is going to be extremely painful and destabalize the code
base, but it has to be done for dynamic service handlers to really work
properly.  It should also make the code more readable.

One tip if you want to keep track of the conn_info in your private data
structure, you should set it internally in the lib_init_fn.  The clm.c
code does this for example.  I was thinking of ways to make a selector
for it, but for now, we can just use this simple hack.

Regards
-steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1049-3.patch
Type: text/x-patch
Size: 13602 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20060125/39737031/1049-3-0001.bin


More information about the Openais mailing list