|
Rich Salz
rsalz at zolera.com
Mon Feb 25 20:52:08 EST 2002
I am sure there are other approaches, but here is what we did.
We were already using SWIG (www.swig.org). I added ONE function to the
the request object, get_swig_handle. This returns a SWIG-compatible
handle to the real apache request object:
+static PyObject * req_get_swig_handle(requestobject *self, PyObject
*args)
+{
+ char ptrbuff[128];
+ SWIG_MakePtr(ptrbuff, (char *)self->request_rec, "_request_rec_p");
+ return Py_BuildValue("s", ptrbuff);
+}
Then it's pretty easy for us to write SWIG-wrapped functions that get
any mod_ssl data we want:
int
UsingSSL(request_rec* r)
{
return ap_ctx_get(r->connection->client->ctx, "ssl") != NULL;
}
I can send more details if necessary ...
--
Zolera Systems, Securing web services (XML, SOAP, Signatures,
Encryption)
http://www.zolera.com
|