Dmitry the Zuryanovich wrote:

>On Wed, May 18, 2005 at 01:54:59PM +0200, David N. Welton wrote:
>
> Hi David, looks like this message is more ideologic than rivet-specific,
>so I reply directly to you.
>  
>
I'm going to CC the rivet-dev list, though, because it's an interesting
discussion!  I hope you don't mind...

>>numeric headers on something that should be a 404?  Perhaps there is a
>>better way of doing things?
>>    
>>
> No! I look at the httpd server as the gateway (sort of API) between 
>HTTP protocol and application.
> When I say "Get this! (200)" I just say - "this content is avaluable TO YOU".
>I do not care about the particular file. 
>
> In my case, I offer some content to the mobile phones (prevously ordered by 
> SMPP
>/Send-The-SMS-Message-And-Get-The-Shit/). I have to check if the file was payed
>by the requester and so on (the tricky /feed/SMTHSTRANGE/nameof.file).
>
> The content is _absouletly_ virtual. It's _not_ a file, and I think that's 
>normal. (I 'puts' it to stdout, prevously configured it to -encoding binary or
>like that)
>  Looks like you came in www space in the Old Times where the requesters
>required The File ;-) In 1993, I suppose? ;-)
>  
>
Aha!  This is what I suspected you were trying to do.  The problem is
that you are fighting against Apache instead of working with it.  What
you want to do is map a URL to some sort of virtual actions...

... and I *think* the response in this case is mod_rewrite, combined
with Rivet.  With mod_rewrite, for instance, you could remap
/feed/SMTHSTRANGE/name.of/file to:

foo.tcl?encnum=SMTHSTRANGE&filename=name.of/file...

using regular expressions.  This is far more elegant and powerful than
trying to back out of a 404 at the last minute.

Check out this and see if what it says works for you:

http://httpd.apache.org/docs/misc/rewriteguide.html

> The mobile phones are really dump. SonyErricsson says that = is a terminator 
>for the url, while Alcatel says it's a regular symbol. SonyErriccson sends
>HEAD while Alcatel/Motorola just GETs.
>  
>
It sends HEAD to get a resource?! Wow...

> Most of them says ? and & are a URL terminator, so I use the virtual 
> directories.
>  
>
In what sense?

>>>GET /feed/NzA5NTEwMjU2MTA_/timofeevgennadii-hozyaikabara.mid HTTP/1.0
>>>      
>>>
> The NzA5NTEwMjU2MTA_ is actually is base64 encoded mobile number phone 
>with [string map {= _} $phone]
>  
>
Interesting... I'm looking at doing a bit of experimentation with mobile
phones myself.

>>You could check and see if in the HEAD case, the Tcl code is even being
>>run.  One way to do this is something like:
>>
>><?
>>set fl [open /tmp/foobar w]
>>puts $fl [clock seconds]
>>close $fl
>>?>
>>    
>>
>I'll try, but I'm _sure_ the TCL code is not executed.
>  
>
It isn't - see my follow up message:-)

-- 
David N. Welton
- http://www.dedasys.com/davidw/

Apache, Linux, Tcl Consulting
- http://www.dedasys.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to