Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the toot Reference Manual, version 0.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 18:02:02 2021 GMT+0.
• Introduction | What toot is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Toot is a stripped down and, hopefully, simplified version of Edi Weitz's Hunchentoot. It does not aim to be backwards compatible with anything and large swaths of Hunchentoot functionality have been cut out. Some of them may be put back someday. Use at your own risk. If it breaks you get to keep both pieces, etc. etc.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The toot system |
A minimal web server originally built by stripping down Edi Weitz’s Hunchentoot
0.0.1
toot.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The toot/packages․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
toot.asd
toot (system)
*toot-version* (special variable)
Next: The toot/rfc2388․lisp file, Previous: The toot․asd file, Up: Lisp files [Contents][Index]
toot (system)
packages.lisp
Next: The toot/specials․lisp file, Previous: The toot/packages․lisp file, Up: Lisp files [Contents][Index]
packages.lisp (file)
toot (system)
rfc2388.lisp
Next: The toot/conditions․lisp file, Previous: The toot/rfc2388․lisp file, Up: Lisp files [Contents][Index]
rfc2388.lisp (file)
toot (system)
specials.lisp
Next: The toot/mime-types․lisp file, Previous: The toot/specials․lisp file, Up: Lisp files [Contents][Index]
specials.lisp (file)
toot (system)
conditions.lisp
Next: The toot/util․lisp file, Previous: The toot/conditions․lisp file, Up: Lisp files [Contents][Index]
conditions.lisp (file)
toot (system)
mime-types.lisp
Next: The toot/cookie․lisp file, Previous: The toot/mime-types․lisp file, Up: Lisp files [Contents][Index]
mime-types.lisp (file)
toot (system)
util.lisp
Next: The toot/set-timeouts․lisp file, Previous: The toot/util․lisp file, Up: Lisp files [Contents][Index]
util.lisp (file)
toot (system)
cookie.lisp
name (method)
Next: The toot/taskmaster․lisp file, Previous: The toot/cookie․lisp file, Up: Lisp files [Contents][Index]
cookie.lisp (file)
toot (system)
set-timeouts.lisp
set-timeouts (function)
Next: The toot/log․lisp file, Previous: The toot/set-timeouts․lisp file, Up: Lisp files [Contents][Index]
set-timeouts.lisp (file)
toot (system)
taskmaster.lisp
Next: The toot/http․lisp file, Previous: The toot/taskmaster․lisp file, Up: Lisp files [Contents][Index]
taskmaster.lisp (file)
toot (system)
log.lisp
stream-logger (class)
Next: The toot/api․lisp file, Previous: The toot/log․lisp file, Up: Lisp files [Contents][Index]
log.lisp (file)
toot (system)
http.lisp
Next: The toot/tests․lisp file, Previous: The toot/http․lisp file, Up: Lisp files [Contents][Index]
http.lisp (file)
toot (system)
api.lisp
Next: The toot/documentation․lisp file, Previous: The toot/api․lisp file, Up: Lisp files [Contents][Index]
api.lisp (file)
toot (system)
tests.lisp
handle-request (method)
Previous: The toot/tests․lisp file, Up: Lisp files [Contents][Index]
tests.lisp (file)
toot (system)
documentation.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The toot-asd package | ||
• The toot package | ||
• The toot-tests package |
Next: The toot package, Previous: Packages, Up: Packages [Contents][Index]
toot.asd
*toot-version* (special variable)
Next: The toot-tests package, Previous: The toot-asd package, Up: Packages [Contents][Index]
A very simple web server.
packages.lisp (file)
Previous: The toot package, Up: Packages [Contents][Index]
Sanity tests for Toot.
packages.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported constants | ||
• Exported special variables | ||
• Exported macros | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported classes |
Next: Exported special variables, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
HTTP return code (202) for ’Accepted’.
specials.lisp (file)
HTTP return code (401) for ’Authorization Required’.
specials.lisp (file)
HTTP return code (502) for ’Bad Gateway’.
specials.lisp (file)
HTTP return code (400) for ’Bad Request’.
specials.lisp (file)
HTTP return code (409) for ’Conflict’.
specials.lisp (file)
HTTP return code (100) for ’Continue’.
specials.lisp (file)
HTTP return code (201) for ’Created’.
specials.lisp (file)
HTTP return code (417) for ’Expectation Failed’.
specials.lisp (file)
HTTP return code (424) for ’Failed Dependency’.
specials.lisp (file)
HTTP return code (403) for ’Forbidden’.
specials.lisp (file)
HTTP return code (504) for ’Gateway Time-out’.
specials.lisp (file)
HTTP return code (410) for ’Gone’.
specials.lisp (file)
HTTP return code (500) for ’Internal Server Error’.
specials.lisp (file)
HTTP return code (411) for ’Length Required’.
specials.lisp (file)
HTTP return code (405) for ’Method Not Allowed’.
specials.lisp (file)
HTTP return code (301) for ’Moved Permanently’.
specials.lisp (file)
HTTP return code (302) for ’Moved Temporarily’.
specials.lisp (file)
HTTP return code (207) for ’Multi-Status’.
specials.lisp (file)
HTTP return code (300) for ’Multiple Choices’.
specials.lisp (file)
HTTP return code (204) for ’No Content’.
specials.lisp (file)
HTTP return code (203) for ’Non-Authoritative Information’.
specials.lisp (file)
HTTP return code (406) for ’Not Acceptable’.
specials.lisp (file)
HTTP return code (404) for ’Not Found’.
specials.lisp (file)
HTTP return code (501) for ’Not Implemented’.
specials.lisp (file)
HTTP return code (304) for ’Not Modified’.
specials.lisp (file)
HTTP return code (200) for ’OK’.
specials.lisp (file)
HTTP return code (206) for ’Partial Content’.
specials.lisp (file)
HTTP return code (402) for ’Payment Required’.
specials.lisp (file)
HTTP return code (412) for ’Precondition Failed’.
specials.lisp (file)
HTTP return code (407) for ’Proxy Authentication Required’.
specials.lisp (file)
HTTP return code (413) for ’Request Entity Too Large’.
specials.lisp (file)
HTTP return code (408) for ’Request Time-out’.
specials.lisp (file)
HTTP return code (414) for ’Request-URI Too Large’.
specials.lisp (file)
HTTP return code (416) for ’Requested range not satisfiable’.
specials.lisp (file)
HTTP return code (205) for ’Reset Content’.
specials.lisp (file)
HTTP return code (303) for ’See Other’.
specials.lisp (file)
HTTP return code (503) for ’Service Unavailable’.
specials.lisp (file)
HTTP return code (101) for ’Switching Protocols’.
specials.lisp (file)
HTTP return code (307) for ’Temporary Redirect’.
specials.lisp (file)
HTTP return code (415) for ’Unsupported Media Type’.
specials.lisp (file)
HTTP return code (305) for ’Use Proxy’.
specials.lisp (file)
HTTP return code (505) for ’Version not supported’.
specials.lisp (file)
Next: Exported macros, Previous: Exported constants, Up: Exported definitions [Contents][Index]
When true, Toot drops into the debugger on unhandled errors. Otherwise unhandled errors signaled while processing requests are logged and a 500 error returned to the client.
specials.lisp (file)
The default connection timeout used when an acceptor is reading from and writing to a socket stream.
specials.lisp (file)
The default content-type header which is returned to the client. If this is text content type, the character set used for encoding the response will automatically be added to the content type in a “charset” attribute.
specials.lisp (file)
The external format used to compute the REQUEST object.
specials.lisp (file)
If this variable is not NIL, it should be bound to a stream to which incoming and outgoing headers will be written for debugging purposes.
specials.lisp (file)
Log level for Lisp errors. Should be one of :ERROR (the default), :WARNING, or :INFO.
specials.lisp (file)
Log level for Lisp warnings. Should be one of :ERROR, :WARNING (the default), or :INFO.
specials.lisp (file)
Whether Lisp backtraces should be logged. Only has an effect if *LOG-LISP-ERRORS-P* is true as well.
specials.lisp (file)
Whether Lisp errors in request handlers should be logged.
specials.lisp (file)
Whether Lisp warnings in request handlers should be logged.
specials.lisp (file)
Whether Lisp errors shown in HTML output should contain backtrace information.
specials.lisp (file)
Whether Lisp errors in request handlers should be shown in HTML output.
specials.lisp (file)
Directory for temporary files created by MAKE-TMP-FILE-NAME.
specials.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Send the response headers (any already set plus any more set via keyword arguments to this macro) and bind the stream to which the response body can be written to STREAM.
Next: Exported generic functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
Abort the handling of a request, sending instead a response with the given response-status-code and either the given body or a default body based on the error code. A request can only be aborted if SEND-HEADERS has not been called. (SEND-HEADERS is called by WITH-RESPONSE-BODY). If a handler neither generates a response nor aborts, then a 404: Not Found response will be sent.
Add an index file name to a directory filename. Defaults to index.html
Returns as two values the user and password (if any) as encoded in the ’AUTHORIZATION’ header. Returns NIL if there is no such header.
Get the value of the cookie with the given name sent by the client or NIL if no such cookie was sent.
Escapes the characters #\<, #\>, #\’, #\", and #\& for HTML output.
Returns the GET parameter with name NAME (a string) - or NIL if there is none. Search is case-sensitive.
Handles the If-Modified-Since header of REQUEST, sending an ’304: Not modified’ response if the time represented by the UTC TIME is the same as the value in the If-Modified-Since header. Also sets the Last Modified header in the response to TIME.
If the request contains a Range header returns the starting position and the number of bytes to transfer. Otherwise returns 0 and bytes-available. An invalid specified range is reported to the client immediately with a ’416: Requested range not satisfiable’ response.
Adds appropriate response headers to completely prevent caching on most browsers.
Returns the GET or the POST parameter with name NAME (a string) - or NIL if there is none. If both a GET and a POST parameter with the same name exist the GET parameter is returned. Search is case-sensitive.
Returns the POST parameter with name NAME (a string) - or NIL if there is none. Search is case-sensitive.
Returns the ’X-Forwarded-For’ incoming http header as the second value in the form of a list of IP addresses and the first element of this list as the first value if this header exists. Otherwise returns the value of REMOTE-ADDR as the only value.
Returns a reason phrase for the HTTP return code STATUS-CODE (which should be an integer) or NIL for return codes Toot doesn’t know.
Redirects the browser to TARGET with status code CODE. Target must be a string and CODE should be one of the 3xx status codes. If TARGET is a full URL starting with a scheme, HOST, PORT and PROTOCOL are ignored. Otherwise, TARGET should denote the path part of a URL and the protocol, host, and port can be specified via keyword args. Any values not specified will be taken from the current request. (Note, however, that if no port was specified in the Host: header of the request, the redirect will likewise have no explicit port; if the protocol was changed this will result in a redirect to the default port for the new protocol. CODE must be a 3xx redirection code and will be sent as status code.
Returns the incoming header with name NAME. NAME can be a keyword (recommended) or a string.
Get the host part of the request’s URI.
Get the path part of the request’s URI.
Get the port part of the request’s URI.
Get the query part of the request’s URI.
Get the scheme part of the request’s URI.
Sends 401: Authorization required reply to require basic HTTP authentication (see RFC 2617) for the realm REALM.
Returns the current value of the outgoing http header named NAME. NAME should be a keyword or a string.
api.lisp (file)
(setf response-header) (function)
Changes the current value of the outgoing http header named NAME (a keyword or a string). If a header with this name doesn’t exist, it is created.
api.lisp (file)
response-header (function)
Verify that a path, translated to a file doesn’t contain any tricky bits such as ’..’
Send the headers and return a stream to which the body of the reply can be written. If the content-type is text/* type, the stream returned will be a character stream that will encode the response properly for the charset specified. If the request was a HEAD request we dynamically abort rather than returning a stream.
Serve the file denoted by PATHNAME. Sends a content type header corresponding to CONTENT-TYPE or (if that is NIL) tries to determine the content type via the file’s suffix. Aborts the request with 404: Not found if the file does not exist. Also handles if-modified-since and range requests appropriately.
Start an existing acceptor listening for connections.
Instantiate an acceptor and start it listening.
Stop an acceptor from listening for connections. It can be restarted with START-ACCEPTOR.
Decodes a URL-encoded STRING which is assumed to be encoded using the external format EXTERNAL-FORMAT.
URL-encodes a string using the external format EXTERNAL-FORMAT.
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
acceptor that accepted this request.
logger object that can log HTTP accesses.
(setf access-logger) (generic function)
automatically generated reader method
http.lisp (file)
access-logger (generic function)
automatically generated writer method
http.lisp (file)
IP address to which the acceptor binds.
body of the request as octets.
body of the request as a stream.
length of the response about to be written.
(setf content-length) (generic function)
automatically generated reader method
http.lisp (file)
content-length (generic function)
automatically generated writer method
http.lisp (file)
the MIME type of the response about to be written.
(setf content-type) (generic function)
automatically generated reader method
http.lisp (file)
content-type (generic function)
automatically generated writer method
http.lisp (file)
cookies sent by the client as an alist.
object responsible for generating error pages.
(setf error-generator) (generic function)
automatically generated reader method
http.lisp (file)
error-generator (generic function)
automatically generated writer method
http.lisp (file)
Used by acceptor to generate an error page for a request based on the http status code.
parameters sent in the query string.
Used by the acceptor to handle a request. Returns
true if the handler actually sends a response. (This is arranged by
a default :around method. If for some reason a more-specific :around
method is defined, it must return the same value.
http.lisp (file)
tests.lisp (file)
api.lisp (file)
object responsible for generating a response to each request.
(setf handler) (generic function)
automatically generated reader method
http.lisp (file)
object that logs miscelaneous messages to the Toot message log.
(setf message-logger) (generic function)
automatically generated reader method
http.lisp (file)
message-logger (generic function)
automatically generated writer method
http.lisp (file)
name of the server, used in to set the Server response header.
automatically generated reader method
http.lisp (file)
automatically generated reader method
cookie.lisp (file)
flag controlling whether acceptor will allow persistent connections.
(setf persistent-connections-p) (generic function)
automatically generated reader method
http.lisp (file)
persistent-connections-p (generic function)
automatically generated writer method
http.lisp (file)
port the acceptor will listen on.
timeout for reading from the client.
IP address of the client side of the socket making the request.
port of the client side of the socket making the request.
complete set of headers sent in the request as an alist.
HTTP method (e.g. GET, POST, HEAD) of the request.
URI of the request as a puri:uri object.
server protocol of the request as a keyword.
HTTP status code of the response being generated.
(setf status-code) (generic function)
automatically generated reader method
http.lisp (file)
status-code (generic function)
automatically generated writer method
http.lisp (file)
object responsible for running the acceptor.
timeout for writing to the client.
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
The object that listens on a socket for connections.
http.lisp (file)
standard-object (class)
:port
port (generic function)
:address
address (generic function)
:name
name (generic function)
:persistent-connections-p
persistent-connections-p (generic function)
(setf persistent-connections-p) (generic function)
:read-timeout
read-timeout (generic function)
:write-timeout
write-timeout (generic function)
:listen-backlog
listen-backlog (generic function)
:ssl-certificate-file
ssl-certificate-file (generic function)
:ssl-private-key-file
ssl-private-key-file (generic function)
:ssl-private-key-password
ssl-private-key-password (generic function)
:handler
handler (generic function)
(setf handler) (generic function)
:error-generator
error-generator (generic function)
(setf error-generator) (generic function)
:taskmaster
taskmaster (generic function)
:access-logger
(make-instance (quote toot:stream-logger) :destination *error-output*)
access-logger (generic function)
(setf access-logger) (generic function)
:message-logger
(make-instance (quote toot:stream-logger) :destination *error-output*)
message-logger (generic function)
(setf message-logger) (generic function)
listen-socket (generic function)
(setf listen-socket) (generic function)
t
shutdown-p (generic function)
(setf shutdown-p) (generic function)
0
requests-in-progress (generic function)
(setf requests-in-progress) (generic function)
(bordeaux-threads:make-condition-variable)
shutdown-queue (generic function)
(setf shutdown-queue) (generic function)
(bordeaux-threads:make-lock "toot-shutdown")
shutdown-lock (generic function)
(setf shutdown-lock) (generic function)
Initarg | Value |
---|---|
:address | nil |
:port | nil |
:name | (format nil "toot ~a" toot-asd::*toot-version*) |
:listen-backlog | 50 |
:taskmaster | (make-instance (if bordeaux-threads:*supports-threads-p* (quote toot::thread-per-connection-taskmaster) (quote toot::single-threaded-taskmaster))) |
:persistent-connections-p | t |
:read-timeout | toot:*default-connection-timeout* |
:write-timeout | toot:*default-connection-timeout* |
:error-generator | (quote toot::default-error-message-generator) |
A handler that serves files found under a given
root directory. Checks the path before serving the file with
specified path-checker which should be a function that takes the
path and returns true if it is safe. If the path checker returns
false, the request is aborted with 403: Forbidden.
api.lisp (file)
standard-object (class)
:root
root (generic function)
(setf root) (generic function)
:path-checker
(function toot:safe-pathname-p)
path-checker (generic function)
(setf path-checker) (generic function)
A logger that writes to a given stream.
log.lisp (file)
standard-object (class)
:destination
destination (generic function)
(bordeaux-threads:make-lock "log-lock")
lock (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal constants | ||
• Internal special variables | ||
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal conditions | ||
• Internal classes |
Next: Internal special variables, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Length of buffers used for internal purposes.
specials.lisp (file)
A 2-element array consisting of the character codes for a CRLF sequence.
specials.lisp (file)
The three-character names of the seven days of the week - needed for cookie date format.
specials.lisp (file)
A link to the website of the underlying Lisp implementation.
specials.lisp (file)
A FLEXI-STREAMS external format used for ‘faithful’ input and output of binary data.
specials.lisp (file)
The three-character names of the twelve months - needed for cookie date format.
specials.lisp (file)
Time in seconds to wait for a new connection to arrive before performing a cleanup run.
specials.lisp (file)
specials.lisp (file)
A FLEXI-STREAMS external format used internally for logging and to encode cookie values.
specials.lisp (file)
Next: Internal macros, Previous: Internal constants, Up: Internal definitions [Contents][Index]
The default charset for text/* content-types.
specials.lisp (file)
taskmaster.lisp (file)
taskmaster.lisp (file)
Used to map numerical return codes to reason phrases.
specials.lisp (file)
specials.lisp (file)
A hash table which maps file suffixes to MIME types.
mime-types.lisp (file)
An alist where the cars are MIME types and the cdrs are lists of file suffixes for the corresponding type.
mime-types.lisp (file)
tests.lisp (file)
Counter used in creating tmp filenames.
specials.lisp (file)
Lock to protect access to *tmp-counter*.
specials.lisp (file)
A string denoting the current version of Toot. Used for diagnostic output.
toot.asd
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Shortcut to define constants for return codes. NAME is a Lisp symbol, VALUE is the numerical value of the return code, and REASON-PHRASE is the phrase (a string) to be shown in the server’s status line.
specials.lisp (file)
Make sure VALUE is evaluated only once (to appease SBCL).
specials.lisp (file)
Like HANDLER-CASE, but observes *CATCH-ERRORS-P*.
conditions.lisp (file)
Like IGNORE-ERRORS, but observes *CATCH-ERRORS-P*.
conditions.lisp (file)
Returns a vector with the same length and the same elements as
VECTOR (a variable holding a vector) but having element type
NEW-TYPE. If CONVERTER is not NIL, it should designate a function
which will be applied to each element of VECTOR before the result is
stored in the new vector. The resulting vector will have a fill
pointer set to its end.
The macro also uses SETF to store the new vector in VECTOR.
Executes BODY and invokes the debugger if an error is signaled and *CATCH-ERRORS-P* is NIL.
conditions.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
Accept connections on our listen socket and hand them back to the taskmaster via handle-incoming-connection. Called by taskmaster’s execute-acceptor.
tests.lisp (file)
Whether input chunking is currently switched on for the acceptor’s content stream.
taskmaster.lisp (file)
rfc2388.lisp (file)
rfc2388.lisp (file)
The rfc2388 code is buggy in that it operates on a character stream and thus only accepts encodings which are 8 bit transparent. In order to support different encodings for parameter values submitted, we post process whatever string values the rfc2388 package has returned.
Returns the current value of the outgoing cookie named NAME. Search is case-sensitive.
Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.
SYS:SRC;CODE;SEQ.LISP (not found)
Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.
SYS:SRC;CODE;SEQ.LISP (not found)
Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.
SYS:SRC;CODE;SEQ.LISP (not found)
Create a thread for handling a single request
taskmaster.lisp (file)
taskmaster.lisp (file)
A function that generates a bare-bones error page to be used as an error page generator.
Returns the relative portion of URL relative to URL-PREFIX, similar to what ENOUGH-NAMESTRING does for pathnames.
tests.lisp (file)
Creates and returns an external format corresponding to the value of the content type header provided in CONTENT-TYPE. If the content type was not set or if the character set specified was invalid, NIL is returned.
Set certain headers automatically based on values in the request object.
rfc2388.lisp (file)
Find header by label from set of headers.
rfc2388.lisp (file)
Find header parameter by name from set of parameters.
rfc2388.lisp (file)
tests.lisp (file)
tests.lisp (file)
tests.lisp (file)
tests.lisp (file)
Converts a list FORM-URL-ENCODED-LIST of name/value pairs into an alist. Both names and values are url-decoded while doing this.
Return the value for the Content-Type header, including a charset if it’s a text/* type.
Returns a string with a backtrace of what the Lisp system thinks is the "current" error.
conditions.lisp (file)
rfc2388.lisp (file)
Returns the peer address and port of the socket SOCKET as two values. The address is returned as a string in dotted IP address notation.
mime-types.lisp (file)
rfc2388.lisp (file)
rfc2388.lisp (file)
rfc2388.lisp (file)
Tests whether TOKEN is a string which is a valid ’token’ according to HTTP/1.1 (RFC 2068).
cookie.lisp (file)
specials.lisp (file)
taskmaster.lisp (file)
Signals an error of type TOOT-SIMPLE-ERROR with the provided format control and arguments.
conditions.lisp (file)
Returns the universal time TIME as a string in full ISO format.
Should the current connection be kept alive? Secondary value indicates whether the client explicitly requested keep-alive. (Always the same as the primary value for HTTP/1.0 but potentially different in HTTP/1.1.)
taskmaster.lisp (file)
Returns true if CHAR is a linear-whitespace-char (LWSP-char). Either space or tab, in short.
rfc2388.lisp (file)
rfc2388.lisp (file)
Make a handler that handles the request with SUB-HANDLER if the file name of the request is exactly the given PATH.
tests.lisp (file)
rfc2388.lisp (file)
Make a stream just for writing the HTTP headers.
rfc2388.lisp (file)
tests.lisp (file)
Returns the Content-Type header of mime-part PART.
rfc2388.lisp (file)
rfc2388.lisp (file)
rfc2388.lisp (file)
Used to signal an error if an operation named NAME is not implemented.
conditions.lisp (file)
taskmaster.lisp (file)
Signals an error of type PARAMETER-ERROR with the provided format control and arguments.
conditions.lisp (file)
Returns content-type which is parsed from STRING.
rfc2388.lisp (file)
Reads and parses a ‘Content-Type’ header and returns it as three values - the type, the subtype, and the requests’ character set as specified in the ’charset’ parameter in the header, if there is one and if the content type is "text". CONTENT-TYPE-HEADER is supposed to be the corresponding header value as a string.
Parse the REQUEST body as multipart/form-data, assuming that its content type has already been verified. Returns the form data as alist or NIL if there was no data or the data could not be parsed.
Creates an alist of POST parameters from the stream STREAM which is supposed to be of content type ’multipart/form-data’.
Actually process the connection accepted via accept connection. Called by taskmaster’s handle-incoming-connection, possibly in a different thread than accept-connection is running in.
Process a single request. Called repeatedly by process-connection.
Quotes string according to RFC 2616’s definition of ‘quoted-string’.
Read the post data and return it as a vector of octets.
Read the post parameters from the body of the request and return them as an alist.
Reads incoming headers from the client via STREAM. Returns as multiple values the headers as an alist, the request-method, the URI, and the protocol of the request. The reading of the headers is handled by Chunga’s read-http-headers method.
Reads from STREAM up to the next boundary. Returns two values: read data (nil if DISCARD is true), and true if the boundary is not last (i.e., there’s more data).
rfc2388.lisp (file)
Return a stream from which the body of the request can be read. If the request specified a content-length, this stream will not read beyond it. And if the request is using chunked transfer encoding, the stream will be a chunked stream that will return :eof when it gets to the end of the input. After the request has been handled, any input remaining on the stream will be drained.
tests.lisp (file)
tests.lisp (file)
Generates a time string according to RFC 1123. Default is current time.
Send a full response with the given content as the body.
Send the response headers and return the stream to which the body of the response can be written. The stream is a binary stream. The public API function, SEND-HEADERS will wrap that stream in a flexi-stream based on the content-type and charset, if needed. Thus function is for functions that are going to take care of encoding the response themselves, such as SERVE-FILE, which just dumps an already encoded to the steam as octets. If the request was a HEAD request we dynamically abort rather than returning a stream.
Send a response to the client before we’ve created a request object. This can be used by taskmasters when they cannot accept a connection.
Sets up timeouts on the given USOCKET object. READ-TIMEOUT is the read timeout period, WRITE-TIMEOUT is the write timeout, specified in (fractional) seconds. The timeouts can either be implemented using the low-level socket options SO_RCVTIMEO and SO_SNDTIMEO or some other, implementation specific mechanism. On platforms that do not support separate read and write timeouts, both must be equal or an error will be signaled. READ-TIMEOUT and WRITE-TIMEOUT may be NIL, which means that the corresponding socket timeout value will not be set.
set-timeouts.lisp (file)
Returns the position of first non-linear-whitespace character in STRING bound by START and END.
rfc2388.lisp (file)
tests.lisp (file)
tests.lisp (file)
cookie.lisp (file)
tests.lisp (file)
tests.lisp (file)
Signals a warning of type TOOT-SIMPLE-WARNING with the provided format control and arguments.
conditions.lisp (file)
tests.lisp (file)
Returns content-type CT in string representation.
rfc2388.lisp (file)
taskmaster.lisp (file)
Next: Internal conditions, Previous: Internal functions, Up: Internal definitions [Contents][Index]
automatically generated reader method
taskmaster.lisp (file)
automatically generated writer method
taskmaster.lisp (file)
conditions.lisp (file)
automatically generated reader method
cookie.lisp (file)
automatically generated writer method
cookie.lisp (file)
Called on a taskmaster which should call accept-connections on the acceptor.
taskmaster.lisp (file)
automatically generated reader method
cookie.lisp (file)
automatically generated writer method
cookie.lisp (file)
Called on a taskmaster to handle a new connection by calling process-connection on acceptor.
taskmaster.lisp (file)
automatically generated reader method
tests.lisp (file)
automatically generated writer method
tests.lisp (file)
automatically generated reader method
cookie.lisp (file)
automatically generated writer method
cookie.lisp (file)
Write a log entry for the request to the access log.
Write a log entry to the message log.
log.lisp (file)
http.lisp (file)
http.lisp (file)
This generic function is called whenever a
condition CONDITION is signaled in Toot. You might want to specialize
it on specific condition classes for debugging purposes. The default
method invokes the debugger with CONDITION if *CATCH-ERRORS-P* is
NIL.
conditions.lisp (file)
conditions.lisp (file)
Parses SOURCE and returs a single MIME header.
Header is a list of the form (NAME VALUE PARAMETERS), PARAMETERS is a list of (NAME . VALUE)
rfc2388.lisp (file)
Returns a MIME part header, or NIL, if there is no header. Header is terminated by CRLF.
Parses MIME entities, returning them as a list. Each element in the list is of form: (body headers), where BODY is the contents of MIME part, and HEADERS are all headers for that part. BOUNDARY is a string used to separate MIME entities.
rfc2388.lisp (file)
automatically generated reader method
cookie.lisp (file)
automatically generated writer method
cookie.lisp (file)
conditions.lisp (file)
automatically generated reader method
cookie.lisp (file)
automatically generated writer method
cookie.lisp (file)
Shutdown the taskmaster, cleaning up any threads it created.
taskmaster.lisp (file)
automatically generated reader method
taskmaster.lisp (file)
automatically generated writer method
taskmaster.lisp (file)
automatically generated reader method
taskmaster.lisp (file)
automatically generated writer method
taskmaster.lisp (file)
automatically generated reader method
taskmaster.lisp (file)
automatically generated writer method
taskmaster.lisp (file)
automatically generated reader method
taskmaster.lisp (file)
automatically generated reader method
taskmaster.lisp (file)
automatically generated reader method
taskmaster.lisp (file)
automatically generated reader method
taskmaster.lisp (file)
automatically generated writer method
taskmaster.lisp (file)
automatically generated reader method
cookie.lisp (file)
automatically generated writer method
cookie.lisp (file)
Next: Internal classes, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
This warning is signalled when an operation (like SETUID for example) is not implemented for a specific Lisp.
conditions.lisp (file)
toot-error (condition)
operation (method)
The name of the unimplemented operation.
:operation
operation (generic function)
Signalled if a function was called with incosistent or illegal parameters.
conditions.lisp (file)
toot-simple-error (condition)
Signaled internally to cause handling of a request to be aborted and a response sent by Toot itself.
conditions.lisp (file)
toot-condition (condition)
:response-status-code
response-status-code (generic function)
:body
(quote nil)
body (generic function)
Superclass for all conditions related to Toot.
conditions.lisp (file)
condition (condition)
Superclass for all errors related to Toot.
conditions.lisp (file)
Like TOOT-ERROR but with formatting capabilities.
conditions.lisp (file)
parameter-error (condition)
Like TOOT-WARNING but with formatting capabilities.
conditions.lisp (file)
Superclass for all warnings related to Toot.
conditions.lisp (file)
toot-simple-warning (condition)
Previous: Internal conditions, Up: Internal definitions [Contents][Index]
cookie.lisp (file)
standard-object (class)
string
:name
name (generic function)
:value
""
value (generic function)
(setf value) (generic function)
:expires
expires (generic function)
(setf expires) (generic function)
:path
path (generic function)
(setf path) (generic function)
:domain
domain (generic function)
(setf domain) (generic function)
:secure
secure (generic function)
(setf secure) (generic function)
:http-only
http-only (generic function)
(setf http-only) (generic function)
http.lisp (file)
standard-object (class)
:remote-addr
remote-addr (generic function)
:remote-port
remote-port (generic function)
:request-method
request-method (generic function)
:server-protocol
server-protocol (generic function)
:request-uri
request-uri (generic function)
get-parameters (generic function)
post-parameters (generic function)
body-stream (generic function)
body-octets (generic function)
:request-headers
request-headers (generic function)
cookies-in (generic function)
toot:+http-ok+
status-code (generic function)
(setf status-code) (generic function)
content-length (generic function)
(setf content-length) (generic function)
toot:*default-content-type*
content-type (generic function)
(setf content-type) (generic function)
toot::*default-charset*
response-charset (generic function)
(setf response-charset) (generic function)
response-headers (generic function)
(setf response-headers) (generic function)
cookies-out (generic function)
(setf cookies-out) (generic function)
headers-sent-p (generic function)
(setf headers-sent-p) (generic function)
t
close-stream-p (generic function)
(setf close-stream-p) (generic function)
:acceptor
acceptor (generic function)
:content-stream
content-stream (generic function)
(setf content-stream) (generic function)
tmp-files (generic function)
(setf tmp-files) (generic function)
tests.lisp (file)
standard-object (class)
:handlers
handlers (generic function)
(setf handlers) (generic function)
taskmaster.lisp (file)
standard-object (class)
A taskmaster that starts one thread for listening
to incoming requests and one new thread for each incoming connection.
If MAX-THREAD-COUNT is null, a new thread will always be created for
each request.
If MAX-THREAD-COUNT is supplied, the number of request threads is
limited to that. Furthermore, if MAX-ACCEPT-COUNT is not supplied, an
HTTP 503 will be sent if the thread limit is exceeded. Otherwise, if
MAX-ACCEPT-COUNT is supplied, it must be greater than MAX-THREAD-COUNT;
in this case, requests are accepted up to MAX-ACCEPT-COUNT, and only
then is HTTP 503 sent.
In a load-balanced environment with multiple Toot servers, it’s
reasonable to provide MAX-THREAD-COUNT but leave MAX-ACCEPT-COUNT null.
This will immediately result in HTTP 503 when one server is out of
resources, so the load balancer can try to find another server.
In an environment with a single Toot server, it’s reasonable
to provide both MAX-THREAD-COUNT and a somewhat larger value for
MAX-ACCEPT-COUNT. This will cause a server that’s almost out of
resources to wait a bit; if the server is completely out of resources,
then the reply will be HTTP 503.
This is the default taskmaster implementation for multi-threaded Lisp implementations.
taskmaster.lisp (file)
standard-object (class)
acceptor-process (generic function)
(setf acceptor-process) (generic function)
(or integer null)
:max-thread-count
taskmaster-max-thread-count (generic function)
(setf taskmaster-max-thread-count) (generic function)
(or integer null)
:max-accept-count
taskmaster-max-accept-count (generic function)
(setf taskmaster-max-accept-count) (generic function)
integer
0
taskmaster-request-count (generic function)
(setf taskmaster-request-count) (generic function)
(bordeaux-threads:make-lock "taskmaster-request-count")
taskmaster-request-count-lock (generic function)
(bordeaux-threads:make-condition-variable)
taskmaster-wait-queue (generic function)
(bordeaux-threads:make-lock "taskmaster-thread-lock")
taskmaster-wait-lock (generic function)
(or string null)
:worker-thread-name-format
"toot-worker-~a"
taskmaster-worker-thread-name-format (generic function)
(setf taskmaster-worker-thread-name-format) (generic function)
Initarg | Value |
---|---|
:max-thread-count | toot::*default-max-thread-count* |
:max-accept-count | toot::*default-max-accept-count* |
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L T |
---|
Jump to: | F L T |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
A B C D E F G H I K L M N O P Q R S T U V W |
---|
Jump to: | (
A B C D E F G H I K L M N O P Q R S T U V W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
+
A B C D E G H L M N O P R S T V W |
---|
Jump to: | *
+
A B C D E G H L M N O P R S T V W |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | A C O P R S T |
---|
Jump to: | A C O P R S T |
---|