| Graham Dumpleton (JIRA) 2005-11-29, 7:47 am |
| [ http://issues.apache.org/jira/brows...action_12358781 ]
Graham Dumpleton commented on MODPYTHON-94:
-------------------------------------------
I thought about the ctypes approach when I proposed the first code I referenced. The problem was how you dealt with the complexity of setting up a call which had to refer to data within the internal mod_python request object C structure which wasn't other
wise visible at the Python layer through the mod_python Python request object. Eg.
variable_value = ssl_var_lookup(
request_object->request_rec->pool,
request_object->request_rec->server,
request_object->request_rec->connection,
request_object->request_rec,
variable_name);
It may well be possible, but it seemed to me to be quite messy and quite prone to bugs/problems due to the disconnect between the C code and Python code. Ie., you change the C structure to add/change stuff and you have to remember to change any Python cod
e which is somehow using ctypes and defining offsets within the structure. Seemed more trouble that it was worth.
> Calling APR optional functions provided by mod_ssl
> --------------------------------------------------
>
> Key: MODPYTHON-94
> URL: http://issues.apache.org/jira/browse/MODPYTHON-94
> Project: mod_python
> Type: New Feature
> Components: core
> Versions: 3.2
> Environment: Apache 2
> Reporter: Deron Meranda
> Attachments: modpython4.tex.patch, requestobject.c.patch
>
> mod_python is not able to invoke APR Optional Functions. There are
> some cases however where this could be of great benifit.
> For example, consider writing an authentication or authorization handler
> which needs to determine SSL properties (even if to just answer the
> simple question: is the connection SSL encrypted). The normal way of
> looking in the subprocess_env for SSL_* variables does not work in those
> early handler phases because those variables are not set until the fixup phase.
> The mod_ssl module though does provide both a ssl_is_https() and
> ssl_var_lookup() optional functions which can be used in earlier
> phases. For example look at how mod_rewrite calls those; using
> the APR_DECLARE_OPTIONAL_FN and APR_RETRIEVE_OPTIONAL_FN
> macros.
> I can see how it might be very hard to support optional functions in
> general because of the C type linkage issue, but perhaps a select few
> could be coded directly into mod_python.
|