[Mongrel] need help writing a plugin - Still hoping for an answer :-)

Jeroen Houben jeroen at supercool.nl
Fri Mar 16 08:40:29 EDT 2007


Jan Svitok wrote:
> On 3/15/07, Jeroen Houben <jeroen at supercool.nl> wrote:
>   
>> Jeroen Houben wrote:
>>     
>>> Hi Zed, thanks for your reply.
>>>
>>> Okay I understand the theory, but how do I continue? I thought simply
>>> returning from my process() method would do the trick, but the code
>>> below doesn't work, it gives a 404 for files that do exists, but are not
>>> flv. I just want any file that is not .flv to be served normally.
>>>       
>
> Hi,
>
> if nobody answers, maybe you can resort to reading the mongrel sources ;-)
>
> I suspect that the problem is that the "normal processing"
> plugin is not there. See the lines just after those I posted. Or add
> some traces there to see what's going on(like what handlers are tried
> etc.)
>   

I think you're right, adding some traces gives me this:

outputtings handlers for /10/metadata.yml
Streamert

outputtings handlers for /favicon.ico
Mongrel::Rails::RailsHandler

outputtings handlers for /favicon.ico
Mongrel::Rails::RailsHandler

I wonder why it hasn't registered the Streamert handler in front of the 
rails handler. Here's my config

uri "/movies",
  :handler => plugin("/handlers/streamert"),
  :in_front => true


if I change the first line to  uri "/",

things will work, but I then my plugin gets called for every request. 
Not very efficient, I mean, it's fine for what I'm going to do, but 
having it "listen" only to URLs under /movies seems more elegant.

Anyways, thanks for your help!

Jeroen



More information about the Mongrel-users mailing list