From: Brian Candler Date: 2003-03-08T23:50:06+09:00 Subject: Re: DRB and threads Another minor patch: redirect stderr down the FastCGI pipe. def each (*args) #install_traps can be called by the user first while request = accept handle_request { $stderr = request.err # and $stdout to request.out ? yield(CGI.new(request, *args)) $stderr = STDERR request.finish } break if @@exit_requested end end This gives more informative logs, and also in principle should work if the FastCGI app is external. [Not sure how you'd set that up though; you'd need a program which binds FD 0 to a listening socket, or manages a pool of processes like Apache does] If Moonwolf is around: how about making FCGX_IsCGI available from Ruby (and an equivalent function in the pure Ruby version)? Then we could do: def each_cgi(*args) if iscgi? return yield ::CGI.new(*args) end # ahowards's loop as above end That would let FCGI programs work as normal standalone CGI _and_ as FCGI without any modifications :-) Regards, Brian.