In Files

Parent

FCGI

There is no C version of ‘each_cgi’ Note: for ruby-1.6.8 at least, the constants CGI_PARAMS/CGI_COOKIES are defined within module ‘CGI’, even if you have subclassed it

Constants

ProtocolVersion
FCGI_BEGIN_REQUEST

Record types

FCGI_ABORT_REQUEST
FCGI_END_REQUEST
FCGI_PARAMS
FCGI_STDIN
FCGI_STDOUT
FCGI_STDERR
FCGI_DATA
FCGI_GET_VALUES
FCGI_GET_VALUES_RESULT
FCGI_UNKNOWN_TYPE
FCGI_MAXTYPE
FCGI_NULL_REQUEST_ID
FCGI_RESPONDER

FCGI_BEGIN_REQUSET.role

FCGI_AUTHORIZER
FCGI_FILTER
FCGI_KEEP_CONN

FCGI_BEGIN_REQUEST.flags

FCGI_REQUEST_COMPLETE

FCGI_END_REQUEST.protocolStatus

FCGI_CANT_MPX_CONN
FCGI_OVERLOADED
FCGI_UNKNOWN_ROLE

Public Class Methods

default_connection() click to toggle source
    # File lib/fcgi.rb, line 48
48:     def self::default_connection
49:       ::Socket.for_fd($stdin.fileno)
50:     end
each(&block) click to toggle source
    # File lib/fcgi.rb, line 34
34:     def self::each(&block)
35:       f = default_connection()
36:       Server.new(f).each_request(&block)
37:     ensure
38:       f.close if f
39:     end
each_cgi(*args) click to toggle source
     # File lib/fcgi.rb, line 567
567:   def self::each_cgi(*args)
568:     require 'cgi'
569:     
570:     eval(    class CGI      public :env_table      def self::remove_params        if (const_defined?(:CGI_PARAMS))          remove_const(:CGI_PARAMS)          remove_const(:CGI_COOKIES)        end      end    end # ::CGI class    class FCGI      class CGI < ::CGI        def initialize(request, *args)          ::CGI.remove_params          @request = request          super(*args)          @args = *args        end        def args          @args        end        def env_table          @request.env        end        def stdinput          @request.in        end        def stdoutput          @request.out        end      end # FCGI::CGI class    end # FCGI class,TOPLEVEL_BINDING)
571:     
572:     if FCGI::is_cgi?
573:       yield ::CGI.new(*args)
574:     else
575:       exit_requested = false
576:       FCGI::each {|request|
577:         $stdout, $stderr = request.out, request.err
578: 
579:         yield CGI.new(request, *args)
580:         
581:         request.finish
582:       }
583:     end
584:   end
each_request(&block) click to toggle source
    # File lib/fcgi.rb, line 41
41:     def self::each_request(&block)
42:       f = default_connection()
43:       Server.new(f).each_request(&block)
44:     ensure
45:       f.close if f
46:     end
is_cgi?() click to toggle source
    # File lib/fcgi.rb, line 22
22:     def self::is_cgi?
23:       begin
24:         s = Socket.for_fd($stdin.fileno)
25:         s.getpeername
26:         false
27:       rescue Errno::ENOTCONN
28:         false
29:       rescue Errno::ENOTSOCK, Errno::EINVAL
30:         true
31:       end
32:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.