=pod =begin classdoc Base class for CGIHandler classes. Provides an interface definition for the single handleCGI() method.
Copyright© 2008, Dean Arnold, Presicient Corp., USA
All rights reserved.
Licensed under the Academic Free License version 3.0, as specified in the
License.txt file included in this software package, or at
OpenSource.org.
@author D. Arnold
@since 2008-03-21
@self $self
=end classdoc
=cut
package HTTP::Daemon::Threaded::CGIHandler;
use HTTP::Daemon::Threaded::Logable;
use base qw(HTTP::Daemon::Threaded::Logable);
use strict;
use warnings;
our $VERSION = '0.91';
=pod
=begin classdoc
Constructor. Stores ContentParams, SessionCache, and Logger objects,
and performs any content-specific initialization.
@param LogLevel (optional) logging level; 1 => errors only; 2 => errors and warnings only; 3 => errors, warnings,
and info messages; default 1
@param EventLogger (optional) Instance of a HTTP::Daemon::Threaded::Logger to receive
event notifications (except for web requests)
@param SessionCache (optional) threads::shared object implementing HTTP::Daemon::Threaded::SessionCache
@param ContentParams (optional) name of a ContentsParam concrete implementation
@returns a HTTP::Daemon::Threaded::CGIHandler object
=end classdoc
=cut
sub new {
my ($class, %args) = @_;
return bless \%args, $class;
}
=pod
=begin classdoc
Generate and send content. Uses CGI protocol to extract request information
from either %ENV or the provided
exit() here, but
simply return (ala FastCGI). In all other respects, this behaves like
regular CGI protocol. However, be advised that STDOUT is redirected to a scalar
(via PerlIO :scalar layer) until the complete response is generated, and
so the handler should be judicious about the size of content returned. Finally,
be advised that %ENV has been local'ized; thus,
any changes to it will not be seen by forked processes.
@xs
@param $cgi