HTTP-Daemon-Threaded

 view release on metacpan or  search on metacpan

lib/HTTP/Daemon/Threaded.pod  view on Meta::CPAN

processed as follows:

=over 4

=item *

If a SessionCache was provided, the client is checked for a cookie; if one exists,
WebClient invokes the SessionCache to retrieve or create a Session object for the client.

=item *

The URI and method headers are retrieved and validated. If url-form-encoded
parameters are provided, they are extracted; if the request is a multipart POST
request, the parts are collected. If the request is a PUT, the decoded request
content is collected.

=item *

The URI is successively applied to the content handler map regular expressions until
a match is found. If no match is found, a 404 HTTP status is returned to the client.

=item *

If the matching handler object implements HDT::CGIHandler, a CGI environment
and L<CGI> object are constructed, and STDIN/STDOUT/STDERR are rerouted to
scalar buffers (via PerlIO C<:scalar> layer, before the handlers'
C<handleCGI()> method is called. On return, the scalar buffers are used
to generate the response and send it to the client.

=item *

If the matching handler object implements HDT::Content, the client connection
object, URI, request object, URI parameters,
and the session object (if any) are passed to the content handler,
which is responsible for producing the content into an HTTP::Response object
and sending it back to the client.

=back

WebClient objects will hold onto a client connection (in conformance with
HTTP 1.1 connection persistance) until either the client explicitly disconnects,
or any configured inactivity timer expires, at which point any session for
the connection is closed, the connection is closed, and the WebClient returns
itself to the free pool.

=head1 SEE ALSO

L<Thread::Apartment>

L<HTTP::Daemon>

L<HTTP::Request::AsCGI> was used as a reference for implementing CGI
support.

=head1 TO DO

=over 4

=item SSL Support

Via Crypt::SSLeay(or IO::Socket::SSL) + OpenSSL

=item Default User Auth support

Currently no user authorization/authentication classes are defined;
some abstract class is needed to encapsulate such functionality.

=item More/Better Session/SessionCache subclasses

The current session management implementation is non-persistent,
and cookie based. Persistent, URI-rewrite or other mechanisms
are desirable.

=item Multiplex WebClient

Permit a WebClient to handle multiple open sockets.

=item DBI Connection/Statement ppols

Add DBIPool object to contain both DBI (rather, DBIx::Threaded)
connection and statement pools

=back

=head1 AUTHOR, COPYRIGHT, AND LICENSE

Copyright(C) 2006-2008, Dean Arnold, Presicient Corp., USA. All rights reserved.

Licensed under the Academic Free License version 3.0, as at OpenSource.org
L<http://www.opensource.org/licenses/afl-3.0.php>.



( run in 1.749 second using v1.01-cache-2.11-cpan-97f6503c9c8 )