++ed by:
PLICEASE HAMMER DRAEGTUN FUKAI

4 PAUSE users
2 non-PAUSE users.

Brock Wilcox

NAME

Continuity::Adapt::HttpDaemon - Use HTTP::Daemon to get HTTP requests

DESCRIPTION

This is the default and reference HTTP adaptor for Continuity.

An adaptor interfaces between the continuation server (Continuity) and the web server (HTTP::Daemon, FastCGI, etc). It provides incoming HTTP requests to the continuation server.

This adapter interfaces with HTTP::Daemon.

This module was designed to be subclassed to fine-tune behavior.

METHODS

$adapter = Continuity::Adapt::HttpDaemon->new(...)

Create a new continuation adaptor and HTTP::Daemon. This actually starts the HTTP server, which is embeded. It takes the same arguments as the HTTP::Daemon module, and those arguments are passed along. It also takes the optional argument docroot => '/path'. This adapter may then be specified for use with the following code:

  my $server = Contuinity->new(adapter => $adapter);

This method is required for all adaptors.

get_request() - map a URL path to a filesystem path

Called in a loop from Contuinity.

Returns the empty list on failure, which aborts the server process. Aside from the constructor, this is the heart of this module.

This method is required for all adaptors.

$adapter->map_path($path)

Decodes URL-encoding in the path and attempts to guard against malice. Returns the processed path.

send_static($request)

Sends a static file off of the filesystem.

We cheat here... use 'magic' to get mimetype and send that followed by the contents of the file.

This may be obvious, but you can't send binary data as part of the same request that you've already sent text or HTML on, MIME aside.

See Continuity::Request for API documentation.

This is what gets passed through a queue to coroutines when new requests for them come in. It needs to encapsulate:

* The connection filehandle * CGI parameters cache

XXX todo: understands GET parameters and POST in application/x-www-form-urlencoded format, but not POST data in multipart/form-data format. Use the AsCGI thing if you actually really need that (it's used for file uploads). # XXX check request content-type, if it isn't x-form-data then throw an error # XXX pass in multiple param names, get back multiple param values

Delegates requests off to the request object it was initialized from.

SEE ALSO

Continuity

AUTHOR

  Brock Wilcox <awwaiid@thelackthereof.org> - http://thelackthereof.org/
  Scott Walters <scott@slowass.net> - http://slowass.net/

COPYRIGHT

  Copyright (c) 2004-2007 Brock Wilcox <awwaiid@thelackthereof.org>. All rights
  reserved.  This program is free software; you can redistribute it and/or
  modify it under the same terms as Perl itself.