struct CitContext no longer contains separate module-specific pointers for
authorArt Cancro <ajc@citadel.org>
Wed, 21 Nov 2007 04:54:19 +0000 (04:54 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 21 Nov 2007 04:54:19 +0000 (04:54 +0000)
commit2ed96d7a59a16ca0ebb5707f32044dc411bde25a
treedfbafd09761ad60c2238b22af4971ed7d472681d
parent4b922c4d6262b1b1cc13f13b7e43b8b6ae19751f
struct CitContext no longer contains separate module-specific pointers for
things like IMAP state, SMTP state, POP3 state, managesieve state, etc.
These four modules now use a single 'service_specific_data' pointer, which
is cast to whatever data type the module is using.  This is possible because
only one is used at a time (a session cannot be POP3 and SMTP simultaneously,
for example).  As before, when a module allocates memory and places
a pointer to it in this location, the module's cleanup function
continues to be responsible for freeing it, and as before, it must not
free this pointer under any other circumstances.

Third-party modules which implement new server protocols now have a place
to store session data without modifying the server core.  Just follow one
of the existing server protocol modules as an example.
citadel/modules/imap/serv_imap.c
citadel/modules/imap/serv_imap.h
citadel/modules/managesieve/serv_managesieve.c
citadel/modules/pop3/serv_pop3.c
citadel/modules/pop3/serv_pop3.h
citadel/modules/smtp/serv_smtp.c
citadel/server.h