Re: Various musings about the request URL / URI / whatever

2005-11-29 Thread Mike Looijmans
Daniel J. Popowich wrote: By the Host header. I've been looking into this issue tonight and think I have the answers (but it's really late, so I'll save the gory details for tomorrow). In brief: typically, req.hostname is set from the Host header and, in fact, when I telnet to apache and issue a

Re: [jira] Commented: (MODPYTHON-93) Improve util.FieldStorage efficiency

2005-11-29 Thread Mike Looijmans
I am still not convinced we need an index. I'd like to see some concrete proof that we're not engaging in "overoptimization" here - is this really a bottleneck for anyone? Well, I need to get some real work done today, but I will do some benchmarking at some point. It's not like there's a big

Re: [jira] Commented: (MODPYTHON-93) Improve util.FieldStorage efficiency

2005-11-29 Thread Mike Looijmans
Just one comment. It seems like it would be better just to make add_method inline, since everything else in __init__ is, and it never gets called from anywhere else. s/_method/_field/g The thing I had in mind when I built the add_field method was that I could subclass FieldStorage and give t

Re: Various musings about the request URL / URI / whatever

2005-11-29 Thread Daniel J. Popowich
Gregory (Grisha) Trubetskoy writes: > > On Tue, 29 Nov 2005, Nicolas Lehuen wrote: > > > If I understand you correctly, req.hostname is not reliable in case where > > virtual hosting is not used. What about server.server_hostname, which seems > > to be used by the code from mod_rewrite you posted

[jira] Commented: (MODPYTHON-94) Calling APR optional functions provided by mod_ssl

2005-11-29 Thread Deron Meranda (JIRA)
[ http://issues.apache.org/jira/browse/MODPYTHON-94?page=comments#action_12358844 ] Deron Meranda commented on MODPYTHON-94: Graham said: "Can Apache be built without HTTPS support? Does this patch still work and does it gracefully fail or give neg

Re: Various musings about the request URL / URI / whatever

2005-11-29 Thread Jim Gallacher
Gregory (Grisha) Trubetskoy wrote: On Tue, 29 Nov 2005, Jim Gallacher wrote: Daniel J. Popowich wrote: Here, here!! I've wanted parsed_uri to work as expected for quite some time...I'm actually in a position where I could devote some time to tracking this down. If apache doesn't provide i

Re: Various musings about the request URL / URI / whatever

2005-11-29 Thread Gregory (Grisha) Trubetskoy
On Tue, 29 Nov 2005, Jim Gallacher wrote: Daniel J. Popowich wrote: Here, here!! I've wanted parsed_uri to work as expected for quite some time...I'm actually in a position where I could devote some time to tracking this down. If apache doesn't provide it, I think mod_python should at least

Re: Various musings about the request URL / URI / whatever

2005-11-29 Thread Jim Gallacher
Daniel J. Popowich wrote: Jim Gallacher writes: Nicolas Lehuen wrote: Second question, if there isn't any simpler way to do this, should we add it to mod_python ? Either as a function like above in mod_python.util, or as a member of the request object (named something like url to match the

Re: [jira] Commented: (MODPYTHON-93) Improve util.FieldStorage efficiency

2005-11-29 Thread Nick
Jim Gallacher wrote: Nick wrote: Just one comment. It seems like it would be better just to make add_method inline, since everything else in __init__ is, and it never gets called from anywhere else. add_method? Haha, thanks, I haven't had coffee yet. The add_item method, that is. :) I a

Re: [jira] Commented: (MODPYTHON-93) Improve util.FieldStorage efficiency

2005-11-29 Thread Gregory (Grisha) Trubetskoy
On Tue, 29 Nov 2005, Jim Gallacher wrote: I still think the correct place to create the index dictionary is in the __init__ phase. Using the dictionary-on-demand idea only improves performance on the second access to a form field. For the first access you are still iterating through the whole

Re: Various musings about the request URL / URI / whatever

2005-11-29 Thread Gregory (Grisha) Trubetskoy
On Tue, 29 Nov 2005, Nicolas Lehuen wrote: def current_url(req): [snip] # host current_url.append(req.hostname) [snip] This part isn't going to work reliably if you are not using virtual hosts and just bind to an IP number. Deciphering the URL is an impossible task - I used to h

Re: Various musings about the request URL / URI / whatever

2005-11-29 Thread Jim Gallacher
Nicolas Lehuen wrote: Hi, Is it me or is it quite tiresome to get the URL that called us, or get the complete URL that would call another function ? When performing an external redirect (using mod_python.util.redirect for example), we MUST (as per RFC) provide a full URL, not a relative one.

Re: [SPAM] [mod_python] [SPAM] ANNOUNCE: Mod_python 3.2.5 Beta

2005-11-29 Thread Jorey Bump
David Fraser wrote: Is anyone else subscribed to [EMAIL PROTECTED] It was that one that had the SPAM in the subject, and my mail server doesn't have the ability to add these :-) It's the mail server at modpython.org. The spam threshold is set too low (2.4). I recommend raising it to 5 and cha

[jira] Commented: (MODPYTHON-94) Calling APR optional functions provided by mod_ssl

2005-11-29 Thread Graham Dumpleton (JIRA)
[ http://issues.apache.org/jira/browse/MODPYTHON-94?page=comments#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 t

Re: [jira] Commented: (MODPYTHON-93) Improve util.FieldStorage efficiency

2005-11-29 Thread Mike Looijmans
How about we make the first call to get or __getitem__ create the dictionary? We could put code in __getattr__ to create it when it's referenced. Here is the patch to util.py to use a dictionary-on-demand. Lots of code removed for this one, and a few lines added. There's also a brand new items