|
Home > Archive > Apache Mod-Python > February 2006 > Constructing of a URL for location redirect.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Constructing of a URL for location redirect.
|
|
| Graham Dumpleton 2006-02-17, 11:10 pm |
| Just sending this while I remember ...
A while back there was long discussion on constructing a URL for
location
redirect. While digging through Apache stuff, I stumbled across the
function:
ap_construct_url()
This takes an absolute path and constructs a full URL based on
information
Apache knows about request.
Does this Apache function perhaps do what was wanted, or is it going to
have the same issues as was discussed before whereby certain cases
wouldn't work?
If it works, just need to expose it in the request object.
See notes about thus function in:
http://www.kuzbass.ru/docs/apache_c_mod_perl/158.htm
Graham
| |
| Nicolas Lehuen 2006-02-17, 11:10 pm |
| It looks good, which proves the power of RTFM. We should test it, of
course, to make sure subtleties like virtual host are taken into
account (the doc says so but the code knows better).
BTW, did we ever considered using SWIG to map the Apache API ? I know
it can be quite tricky to use, but it could be a real time saver.
Regards,
Nicolas
2006/2/16, Graham Dumpleton <grahamd@dscpl.com.au>:
> Just sending this while I remember ...
>
> A while back there was long discussion on constructing a URL for
> location
> redirect. While digging through Apache stuff, I stumbled across the
> function:
>
> ap_construct_url()
>
> This takes an absolute path and constructs a full URL based on
> information
> Apache knows about request.
>
> Does this Apache function perhaps do what was wanted, or is it going to
> have the same issues as was discussed before whereby certain cases
> wouldn't work?
>
> If it works, just need to expose it in the request object.
>
> See notes about thus function in:
>
> http://www.kuzbass.ru/docs/apache_c_mod_perl/158.htm
>
> Graham
>
>
>
| |
|
| Nicolas Lehuen wrote:
> BTW, did we ever considered using SWIG to map the Apache API ? I know
> it can be quite tricky to use, but it could be a real time saver.
That's essentially what mod_snake did, and why I liked it so much. Though I
don't remember if it used swig or pyrex.
Nick
| |
| Gregory (Grisha) Trubetskoy 2006-02-17, 11:10 pm |
| On Thu, 16 Feb 2006, Nick wrote:
> Nicolas Lehuen wrote:
>
> That's essentially what mod_snake did, and why I liked it so much. Though I
> don't remember if it used swig or pyrex.
It used SWIG. I'm -1 on using SWIG, I like the hand-crafted quality of
mod_python.
SWIG in my opinion is good when you want some kind of an API made
available to you quickly, but in a static environment where can put some
thought into functionality, usability, Pythonic-ness of every approach,
write documentation with good examples and a meaningful test case SWIG
does not buy much.
If someone just wanted to map the APR to Python - they can always use
SWIG, but that's not what mod_python is about.
Grisha
| |
|
| Gregory (Grisha) Trubetskoy wrote:
> SWIG in my opinion is good when you want some kind of an API made
> available to you quickly, but in a static environment where can put some
> thought into functionality, usability, Pythonic-ness of every approach,
> write documentation with good examples and a meaningful test case SWIG
> does not buy much.
>
> If someone just wanted to map the APR to Python - they can always use
> SWIG, but that's not what mod_python is about.
All true; mod_python is a layer up from the apache API, so there's no way
the SWIGed API could come close to replacing it. I just found it generally
more convenient to work in Python rather than C, even if it's only a thin
layer above that, and I think there is some merit to using it in some
places, carefully wrapped in a Python class or module.
That said, I don't really see mod_python changing so radically at this point
in the game. It's fun to think about, though. In a masochistic kind of way.
Nick
| |
| Jim Gallacher 2006-02-17, 11:10 pm |
| Nick wrote:
> Gregory (Grisha) Trubetskoy wrote:
>
>
>
> All true; mod_python is a layer up from the apache API, so there's no way
> the SWIGed API could come close to replacing it. I just found it generally
> more convenient to work in Python rather than C, even if it's only a thin
> layer above that, and I think there is some merit to using it in some
> places, carefully wrapped in a Python class or module.
>
> That said, I don't really see mod_python changing so radically at this point
> in the game. It's fun to think about, though. In a masochistic kind of way.
We could always try to convince the ASF to rewrite apache in PyPy. 
Jim
|
|
|
|
|