[mod_python] Passing C structure into python?

Miguel Marques miguel at yorku.ca
Thu Mar 15 16:48:51 EST 2001


Greetings...

I previously had a authentication handler written in python which 
using a python extension opened a connection a database.

Since the main request handler was also written in python and needed
to use that connection to the database I just assigned the connection
object to a member of the request object in the authentication
handler.  The main request handler then could access the database
connection using that member of the request object.

I have now rewritten the authentication handler as an apache module
written in C but I still would like to pass that connection to the
database into the main request handler which is written in python.
(I'm opening a connection to the database on both places right now
which is impacting performance)

Any idea how I could do that?  I assume I'll need another python C
module to return me a python variable to use in the main request handler.
The question is where do I store the connection C structure in the
authentication handler so that the handler can get at it?
I don't think I can use the notes field for that.

Any help would be greatly appreciated...

						Miguel

C. Miguel Marques, York University, Computing & Network Services
e-mail: miguel at yorku.ca, voice: (416)736-2100x22684, fax: (416)736-5830



More information about the Mod_python mailing list