Re: [cgiapp] Possible patches for ::Server (was: Re: ::Server vs ::Dispatch::Server: Worth having both?)

2008-09-17 Thread Ricardo SIGNES
* Mark Stosberg <[EMAIL PROTECTED]> [2008-09-17T20:57:37]
> > ::Dispatch::Server prefers static files first, ::Server prefers dispatching 
> > first
> 
> I think it is a bug in ::Server that it prefers dispatching server. The
> recommended use of ::Dispatch, and also for Drupal, is to use a rewrite
> rule that will serve static files directly if they match, otherwise the
> request is passed on for possible dispatching. As Michael Peters pointed
> out, this design should have better performance as well. 
> 
> So Ricardo, would you accept a patch to change this ordering?

Almost certainly.  I'll have to check with the other big user/maintainer.

> That will print out "/first/second" and then "/first", but never "/".  I
> think this is a bug in ::Server. Richardo, would you accept a patch to
> make "/" dispatchable? ( "" Would be treated the same ). 

Only if you agree to never put an 'h' in my name again.

-- 
rjbs

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Possible patches for ::Server (was: Re: ::Server vs ::Dispatch::Server: Worth having both?)

2008-09-20 Thread George Hartzell
Mark Stosberg writes:
 > 
 > > Patches welcome.
 > 
 > I'd like to provide feedback on various proposed changes to 
 > CGI::Application::Server
 > 
 > > Need a way to specify parameters to dispatch()
 > 
 > I disagree. The recommended way to do this to define a 'dispatch_args'
 > routine in your CGI::Application::Dispatch subclass. I think George
 > discovered seperately that the "dispatch_args()" method in
 > ::Dispatch::Server was too magical for it's own good. 
 > [...]

Well, in the defense of ::Dispatch::Server's dispatch_args() method,
it was tripping over a sharp edge in ::Dispatch::dispatch, where the
specialized handling of args_to_new->{TMPL_PATH} blindly concatenates
the existing list of directories with the existing list without
checking for duplicates.

I'm not sure what the Right Thing To Do there might actually be (I'm
not a TMPL_PATH user), but given that the rest of the merging replaces
existing values with newer values the behaviour is Surprising.

Passing arguments to ::Dispatch::dispatch gets pretty prominent
billing in the ::Dispatch documentation, so it's not surprising that
folks use it.

g.

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####