This is the hunchentoot Reference Manual, version 1.3.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:25:35 2024 GMT+0.
hunchentoot/hunchentoot.asd
hunchentoot/url-rewrite/packages.lisp
hunchentoot/url-rewrite/specials.lisp
hunchentoot/url-rewrite/primitives.lisp
hunchentoot/url-rewrite/util.lisp
hunchentoot/url-rewrite/url-rewrite.lisp
hunchentoot/packages.lisp
hunchentoot/lispworks.lisp
hunchentoot/compat.lisp
hunchentoot/specials.lisp
hunchentoot/conditions.lisp
hunchentoot/mime-types.lisp
hunchentoot/util.lisp
hunchentoot/log.lisp
hunchentoot/cookie.lisp
hunchentoot/reply.lisp
hunchentoot/request.lisp
hunchentoot/session.lisp
hunchentoot/misc.lisp
hunchentoot/headers.lisp
hunchentoot/set-timeouts.lisp
hunchentoot/taskmaster.lisp
hunchentoot/acceptor.lisp
hunchentoot/ssl.lisp
hunchentoot/easy-handlers.lisp
The main system appears first, followed by any subsystem dependency.
hunchentoot
Hunchentoot is a HTTP server based on USOCKET and BORDEAUX-THREADS. It supports HTTP 1.1, serves static files, has a simple framework for user-defined handlers and can be extended through subclassing.
BSD-2-Clause
1.3.1
chunga
(system).
cl-base64
(system).
cl-fad
(system).
cl-ppcre
(system).
flexi-streams
(system).
cl+ssl
(system)., for feature (:not (:or :lispworks :hunchentoot-no-ssl))
md5
(system).
alexandria
(system).
rfc2388
(system).
trivial-backtrace
(system).
usocket
(system)., for feature (:not :lispworks)
bordeaux-threads
(system)., for feature (:not :lispworks)
url-rewrite
(module).
packages.lisp
(file).
lispworks.lisp
(file).
compat.lisp
(file).
specials.lisp
(file).
conditions.lisp
(file).
mime-types.lisp
(file).
util.lisp
(file).
log.lisp
(file).
cookie.lisp
(file).
reply.lisp
(file).
request.lisp
(file).
session.lisp
(file).
misc.lisp
(file).
headers.lisp
(file).
set-timeouts.lisp
(file).
taskmaster.lisp
(file).
acceptor.lisp
(file).
ssl.lisp
(file).
easy-handlers.lisp
(file).
Modules are listed depth-first from the system components tree.
hunchentoot/url-rewrite
hunchentoot
(system).
packages.lisp
(file).
specials.lisp
(file).
primitives.lisp
(file).
util.lisp
(file).
url-rewrite.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
hunchentoot/hunchentoot.asd
hunchentoot/url-rewrite/packages.lisp
hunchentoot/url-rewrite/specials.lisp
hunchentoot/url-rewrite/primitives.lisp
hunchentoot/url-rewrite/util.lisp
hunchentoot/url-rewrite/url-rewrite.lisp
hunchentoot/packages.lisp
hunchentoot/lispworks.lisp
hunchentoot/compat.lisp
hunchentoot/specials.lisp
hunchentoot/conditions.lisp
hunchentoot/mime-types.lisp
hunchentoot/util.lisp
hunchentoot/log.lisp
hunchentoot/cookie.lisp
hunchentoot/reply.lisp
hunchentoot/request.lisp
hunchentoot/session.lisp
hunchentoot/misc.lisp
hunchentoot/headers.lisp
hunchentoot/set-timeouts.lisp
hunchentoot/taskmaster.lisp
hunchentoot/acceptor.lisp
hunchentoot/ssl.lisp
hunchentoot/easy-handlers.lisp
hunchentoot/url-rewrite/specials.lisp
packages.lisp
(file).
url-rewrite
(module).
*url-rewrite-fill-tags*
(special variable).
*url-rewrite-tags*
(special variable).
*find-string-hash*
(special variable).
*hyperdoc-base-uri*
(special variable).
hyperdoc-lookup
(function).
hunchentoot/url-rewrite/primitives.lisp
specials.lisp
(file).
url-rewrite
(module).
comment-start-p
(function).
letterp
(function).
name-char-p
(function).
peek-char*
(function).
read-until
(function).
read-while
(function).
whitespacep
(function).
hunchentoot/url-rewrite/util.lisp
primitives.lisp
(file).
url-rewrite
(module).
read-attribute
(function).
read-delimited-string
(function).
read-name
(function).
skip-comment
(function).
skip-whitespace
(function).
hunchentoot/url-rewrite/url-rewrite.lisp
util.lisp
(file).
url-rewrite
(module).
add-get-param-to-url
(function).
rewrite-urls
(function).
starts-with-scheme-p
(function).
url-encode
(function).
hunchentoot/packages.lisp
url-rewrite
(module).
hunchentoot
(system).
hunchentoot/lispworks.lisp
:lispworks
packages.lisp
(file).
hunchentoot
(system).
hunchentoot/compat.lisp
(:not :lispworks)
lispworks.lisp
(file).
packages.lisp
(file).
hunchentoot
(system).
condition-variable-signal
(function).
condition-variable-wait
(function).
get-local-address-and-port
(function).
get-peer-address-and-port
(function).
make-condition-variable
(function).
make-lock
(function).
make-socket-stream
(function).
with-lock-held
(macro).
hunchentoot/specials.lisp
compat.lisp
(file).
lispworks.lisp
(file).
packages.lisp
(file).
hunchentoot
(system).
*acceptor*
(special variable).
*catch-errors-p*
(special variable).
*content-types-for-url-rewrite*
(special variable).
*default-connection-timeout*
(special variable).
*default-content-type*
(special variable).
*file-upload-hook*
(special variable).
*header-stream*
(special variable).
*hunchentoot-default-external-format*
(special variable).
*hunchentoot-version*
(special variable).
*lisp-errors-log-level*
(special variable).
*lisp-warnings-log-level*
(special variable).
*log-lisp-backtraces-p*
(special variable).
*log-lisp-errors-p*
(special variable).
*log-lisp-warnings-p*
(special variable).
*methods-for-post-parameters*
(special variable).
*reply*
(special variable).
*request*
(special variable).
*rewrite-for-session-urls*
(special variable).
*session*
(special variable).
*session-gc-frequency*
(special variable).
*session-max-time*
(special variable).
*session-secret*
(special variable).
*show-lisp-backtraces-p*
(special variable).
*show-lisp-errors-p*
(special variable).
*tmp-directory*
(special variable).
*use-remote-addr-for-sessions*
(special variable).
*use-user-agent-for-sessions*
(special variable).
+http-accepted+
(constant).
+http-already-reported+
(constant).
+http-authorization-required+
(constant).
+http-bad-gateway+
(constant).
+http-bad-request+
(constant).
+http-client-closed-request+
(constant).
+http-conflict+
(constant).
+http-connection-closed-without-response+
(constant).
+http-continue+
(constant).
+http-created+
(constant).
+http-expectation-failed+
(constant).
+http-failed-dependency+
(constant).
+http-forbidden+
(constant).
+http-gateway-time-out+
(constant).
+http-gone+
(constant).
+http-im-a-teapot+
(constant).
+http-im-used+
(constant).
+http-insufficient-storage+
(constant).
+http-internal-server-error+
(constant).
+http-length-required+
(constant).
+http-locked+
(constant).
+http-loop-detected+
(constant).
+http-method-not-allowed+
(constant).
+http-misdirected-request+
(constant).
+http-moved-permanently+
(constant).
+http-moved-temporarily+
(constant).
+http-multi-status+
(constant).
+http-multiple-choices+
(constant).
+http-network-authentication-required+
(constant).
+http-network-connect-timeout-error+
(constant).
+http-no-content+
(constant).
+http-non-authoritative-information+
(constant).
+http-not-acceptable+
(constant).
+http-not-found+
(constant).
+http-not-implemented+
(constant).
+http-not-modified+
(constant).
+http-ok+
(constant).
+http-partial-content+
(constant).
+http-payment-required+
(constant).
+http-permanent-redirect+
(constant).
+http-precondition-failed+
(constant).
+http-precondition-required+
(constant).
+http-processing+
(constant).
+http-proxy-authentication-required+
(constant).
+http-request-entity-too-large+
(constant).
+http-request-header-fields-too-large+
(constant).
+http-request-time-out+
(constant).
+http-request-uri-too-large+
(constant).
+http-requested-range-not-satisfiable+
(constant).
+http-reset-content+
(constant).
+http-see-other+
(constant).
+http-service-unavailable+
(constant).
+http-switching-protocols+
(constant).
+http-temporary-redirect+
(constant).
+http-too-many-requests+
(constant).
+http-unavailable-for-legal-reasons+
(constant).
+http-unprocessable-entity+
(constant).
+http-unsupported-media-type+
(constant).
+http-upgrade-required+
(constant).
+http-use-proxy+
(constant).
+http-variant-also-negotiates+
(constant).
+http-version-not-supported+
(constant).
*access-log-lock*
(special variable).
*close-hunchentoot-stream*
(special variable).
*finish-processing-socket*
(special variable).
*global-session-db-lock*
(special variable).
*headers-sent*
(special variable).
*http-reason-phrase-map*
(special variable).
*hunchentoot-stream*
(special variable).
*hyperdoc-base-uri*
(special variable).
*message-log-lock*
(special variable).
*session-db*
(special variable).
*supports-threads-p*
(symbol macro).
*the-random-state*
(special variable).
*tmp-files*
(special variable).
+buffer-length+
(constant).
+crlf+
(constant).
+day-names+
(constant).
+http-not-extended+
(constant).
+implementation-link+
(constant).
+latin-1+
(constant).
+month-names+
(constant).
+utf-8+
(constant).
def-http-return-code
(macro).
defconstant
(macro).
defvar-unbound
(macro).
hyperdoc-lookup
(function).
hunchentoot/conditions.lisp
specials.lisp
(file).
hunchentoot
(system).
bad-request
(condition).
hunchentoot-condition
(condition).
hunchentoot-error
(function).
hunchentoot-error
(condition).
hunchentoot-warning
(condition).
maybe-invoke-debugger
(generic function).
parameter-error
(function).
parameter-error
(condition).
get-backtrace
(function).
handler-case*
(macro).
hunchentoot-operation-not-implemented-operation
(reader method).
hunchentoot-simple-error
(condition).
hunchentoot-simple-warning
(condition).
hunchentoot-warn
(function).
ignore-errors*
(macro).
not-implemented
(function).
operation-not-implemented
(condition).
with-debugger
(macro).
hunchentoot/mime-types.lisp
conditions.lisp
(file).
hunchentoot
(system).
mime-type
(function).
*mime-type-hash*
(special variable).
*mime-type-list*
(special variable).
hunchentoot/util.lisp
mime-types.lisp
(file).
hunchentoot
(system).
escape-for-html
(function).
http-token-p
(function).
reason-phrase
(function).
rfc-1123-date
(function).
ssl-p
(function).
url-decode
(function).
url-encode
(function).
address-string
(function).
assoc*
(generic function).
cookies-to-alist
(function).
create-random-string
(function).
ensure-parse-integer
(function).
form-url-encoded-list-to-alist
(function).
input-chunking-p
(function).
iso-time
(function).
keep-alive-p
(function).
make-tmp-file-name
(function).
md5-hex
(function).
parse-content-type
(function).
quote-string
(function).
starts-with-one-of-p
(function).
starts-with-p
(function).
upgrade-vector
(macro).
with-conditions-caught-and-logged
(macro).
with-mapped-conditions
(macro).
hunchentoot/log.lisp
util.lisp
(file).
hunchentoot
(system).
with-log-stream
(macro).
hunchentoot/cookie.lisp
log.lisp
(file).
hunchentoot
(system).
cookie-domain
(reader method).
(setf cookie-domain)
(writer method).
cookie-expires
(reader method).
(setf cookie-expires)
(writer method).
cookie-http-only
(reader method).
(setf cookie-http-only)
(writer method).
cookie-max-age
(reader method).
(setf cookie-max-age)
(writer method).
cookie-name
(reader method).
cookie-path
(reader method).
(setf cookie-path)
(writer method).
cookie-secure
(reader method).
(setf cookie-secure)
(writer method).
cookie-value
(reader method).
(setf cookie-value)
(writer method).
initialize-instance
(method).
set-cookie
(function).
set-cookie*
(function).
cookie
(class).
cookie-date
(function).
cookie-same-site
(reader method).
(setf cookie-same-site)
(writer method).
stringify-cookie
(method).
hunchentoot/reply.lisp
cookie.lisp
(file).
hunchentoot
(system).
content-length
(reader method).
content-length*
(function).
(setf content-length*)
(function).
content-type
(reader method).
content-type*
(function).
(setf content-type*)
(function).
cookie-out
(function).
cookies-out
(reader method).
(setf cookies-out)
(writer method).
cookies-out*
(function).
(setf cookies-out*)
(function).
header-out
(function).
(setf header-out)
(generic function).
headers-out
(reader method).
headers-out*
(function).
initialize-instance
(method).
reply
(class).
reply-external-format
(reader method).
(setf reply-external-format)
(writer method).
reply-external-format*
(function).
(setf reply-external-format*)
(function).
return-code
(reader method).
(setf return-code)
(writer method).
return-code*
(function).
(setf return-code*)
(function).
header-out-set-p
(function).
hunchentoot/request.lisp
reply.lisp
(file).
hunchentoot
(system).
authorization
(function).
(setf aux-request-value)
(setf expander).
aux-request-value
(function).
cookie-in
(function).
cookies-in
(reader method).
cookies-in*
(function).
delete-aux-request-value
(function).
get-parameter
(function).
get-parameters
(reader method).
get-parameters*
(function).
handle-if-modified-since
(function).
header-in
(generic function).
header-in*
(function).
headers-in
(reader method).
headers-in*
(function).
host
(function).
initialize-instance
(method).
local-addr
(reader method).
local-addr*
(function).
local-port
(reader method).
local-port*
(function).
parameter
(function).
post-parameter
(function).
post-parameters
(reader method).
post-parameters
(method).
post-parameters*
(function).
process-request
(generic function).
query-string
(reader method).
query-string*
(function).
raw-post-data
(function).
real-remote-addr
(function).
recompute-request-parameters
(function).
referer
(function).
remote-addr
(reader method).
remote-addr*
(function).
remote-port
(reader method).
remote-port*
(function).
request
(class).
request-acceptor
(reader method).
request-method
(reader method).
request-method*
(function).
request-pathname
(function).
request-uri
(reader method).
request-uri*
(function).
script-name
(reader method).
script-name*
(function).
server-protocol
(reader method).
server-protocol*
(function).
session
(reader method).
(setf session)
(writer method).
user-agent
(function).
within-request-p
(function).
aux-data
(reader method).
(setf aux-data)
(writer method).
content-stream
(reader method).
convert-hack
(function).
external-format-from-content-type
(function).
get-post-data
(function).
maybe-read-post-parameters
(function).
parse-multipart-form-data
(function).
parse-path
(function).
parse-rfc2388-form-data
(function).
hunchentoot/session.lisp
request.lisp
(file).
hunchentoot
(system).
delete-session-value
(function).
initialize-instance
(method).
next-session-id
(generic function).
regenerate-session-cookie-value
(function).
remove-session
(function).
reset-session-secret
(function).
reset-sessions
(function).
session
(class).
session-cookie-name
(generic function).
session-cookie-value
(generic function).
session-created
(generic function).
session-db
(generic function).
(setf session-db)
(generic function).
session-db-lock
(generic function).
session-gc
(function).
session-id
(reader method).
session-max-time
(reader method).
(setf session-max-time)
(writer method).
session-remote-addr
(reader method).
session-start
(reader method).
session-too-old-p
(function).
session-user-agent
(reader method).
(setf session-value)
(setf expander).
session-value
(function).
session-verify
(generic function).
start-session
(function).
encode-session-string
(function).
get-stored-session
(function).
session-data
(reader method).
session-last-click
(reader method).
session-string
(reader method).
stringify-session
(function).
with-session-lock-held
(macro).
hunchentoot/misc.lisp
session.lisp
(file).
hunchentoot
(system).
abort-request-handler
(function).
create-folder-dispatcher-and-handler
(function).
create-prefix-dispatcher
(function).
create-regex-dispatcher
(function).
create-static-file-dispatcher-and-handler
(function).
handle-static-file
(function).
no-cache
(function).
redirect
(function).
require-authorization
(function).
add-cookie-value-to-url
(function).
maybe-handle-range-header
(function).
maybe-rewrite-urls-for-session
(function).
scanner-for-get-param
(function).
hunchentoot/headers.lisp
misc.lisp
(file).
hunchentoot
(system).
send-headers
(function).
+valid-protocol-versions+
(constant).
+valid-request-methods+
(constant).
get-request-data
(function).
maybe-add-charset-to-content-type-header
(function).
printable-ascii-char-p
(function).
read-initial-request-line
(function).
send-bad-request-response
(function).
send-response
(function).
send-unknown-protocol-response
(function).
start-output
(function).
write-header-line
(generic function).
hunchentoot/set-timeouts.lisp
headers.lisp
(file).
hunchentoot
(system).
set-timeouts
(function).
hunchentoot/taskmaster.lisp
set-timeouts.lisp
(file).
hunchentoot
(system).
client-as-string
(function).
create-request-handler-thread
(generic function).
decrement-taskmaster-thread-count
(generic function).
execute-acceptor
(generic function).
handle-incoming-connection
(generic function).
increment-taskmaster-thread-count
(generic function).
initialize-instance
(method).
multi-threaded-taskmaster
(class).
one-thread-per-connection-taskmaster
(class).
shutdown
(generic function).
single-threaded-taskmaster
(class).
start-thread
(generic function).
taskmaster
(class).
taskmaster-acceptor
(reader method).
(setf taskmaster-acceptor)
(writer method).
taskmaster-max-accept-count
(generic function).
(setf taskmaster-max-accept-count)
(writer method).
taskmaster-max-thread-count
(generic function).
(setf taskmaster-max-thread-count)
(writer method).
taskmaster-thread-count
(generic function).
(setf taskmaster-thread-count)
(writer method).
too-many-taskmaster-requests
(generic function).
*default-max-accept-count*
(special variable).
*default-max-thread-count*
(special variable).
acceptor-process
(reader method).
(setf acceptor-process)
(writer method).
decrement-taskmaster-accept-count
(method).
handle-incoming-connection%
(method).
increment-taskmaster-accept-count
(method).
note-free-connection
(method).
send-service-unavailable-reply
(function).
taskmaster-accept-count
(reader method).
(setf taskmaster-accept-count)
(writer method).
taskmaster-accept-count-lock
(reader method).
taskmaster-thread-count-lock
(reader method).
taskmaster-wait-lock
(reader method).
taskmaster-wait-queue
(reader method).
taskmaster-worker-thread-name-format
(reader method).
(setf taskmaster-worker-thread-name-format)
(writer method).
wait-for-free-connection
(method).
hunchentoot/acceptor.lisp
taskmaster.lisp
(file).
hunchentoot
(system).
accept-connections
(generic function).
acceptor
(class).
acceptor-access-log-destination
(reader method).
(setf acceptor-access-log-destination)
(writer method).
acceptor-address
(reader method).
acceptor-dispatch-request
(generic function).
acceptor-document-root
(reader method).
(setf acceptor-document-root)
(writer method).
acceptor-error-template-directory
(reader method).
(setf acceptor-error-template-directory)
(writer method).
acceptor-input-chunking-p
(reader method).
(setf acceptor-input-chunking-p)
(writer method).
acceptor-listen-backlog
(reader method).
acceptor-log-access
(generic function).
acceptor-log-message
(generic function).
acceptor-message-log-destination
(reader method).
(setf acceptor-message-log-destination)
(writer method).
acceptor-name
(reader method).
(setf acceptor-name)
(writer method).
acceptor-output-chunking-p
(reader method).
(setf acceptor-output-chunking-p)
(writer method).
acceptor-persistent-connections-p
(reader method).
(setf acceptor-persistent-connections-p)
(writer method).
acceptor-port
(reader method).
acceptor-read-timeout
(reader method).
acceptor-remove-session
(generic function).
acceptor-reply-class
(reader method).
(setf acceptor-reply-class)
(writer method).
acceptor-request-class
(reader method).
(setf acceptor-request-class)
(writer method).
acceptor-requests-in-progress
(reader method).
(setf acceptor-requests-in-progress)
(writer method).
acceptor-ssl-p
(generic function).
acceptor-status-message
(generic function).
acceptor-write-timeout
(reader method).
default-document-directory
(function).
detach-socket
(generic function).
handle-request
(generic function).
initialize-connection-stream
(generic function).
initialize-instance
(method).
log-message*
(function).
print-object
(method).
process-connection
(generic function).
reset-connection-stream
(generic function).
start
(generic function).
start-listening
(generic function).
started-p
(generic function).
stop
(generic function).
acceptor-listen-socket
(reader method).
(setf acceptor-listen-socket)
(writer method).
acceptor-make-request
(function).
acceptor-server-name
(generic function).
acceptor-shutdown-lock
(reader method).
(setf acceptor-shutdown-lock)
(writer method).
acceptor-shutdown-p
(reader method).
(setf acceptor-shutdown-p)
(writer method).
acceptor-shutdown-queue
(reader method).
(setf acceptor-shutdown-queue)
(writer method).
acceptor-taskmaster
(reader method).
do-with-acceptor-request-count-incremented
(function).
make-cooked-message
(function).
string-as-keyword
(function).
wake-acceptor-for-shutdown
(function).
with-acceptor-request-count-incremented
(macro).
hunchentoot/ssl.lisp
(:not :hunchentoot-no-ssl)
acceptor.lisp
(file).
hunchentoot
(system).
acceptor-ssl-certificate-file
(reader method).
acceptor-ssl-p
(method).
acceptor-ssl-privatekey-file
(reader method).
acceptor-ssl-privatekey-password
(reader method).
get-peer-ssl-certificate
(function).
initialize-connection-stream
(method).
initialize-instance
(method).
ssl-acceptor
(class).
hunchentoot/easy-handlers.lisp
ssl.lisp
(file).
acceptor.lisp
(file).
hunchentoot
(system).
*dispatch-table*
(special variable).
acceptor-dispatch-request
(method).
define-easy-handler
(macro).
dispatch-easy-handlers
(function).
easy-acceptor
(class).
easy-ssl-acceptor
(class).
*easy-handler-alist*
(special variable).
compute-array-parameter
(function).
compute-hash-table-parameter
(function).
compute-list-parameter
(function).
compute-parameter
(function).
compute-real-name
(function).
compute-simple-parameter
(function).
convert-parameter
(function).
make-defun-parameter
(function).
Packages are listed by definition order.
hunchentoot
tbnl
alexandria
.
chunga
.
cl-ppcre
.
common-lisp
.
flexi-streams
.
url-rewrite
.
*acceptor*
(special variable).
*catch-errors-p*
(special variable).
*content-types-for-url-rewrite*
(special variable).
*default-connection-timeout*
(special variable).
*default-content-type*
(special variable).
*dispatch-table*
(special variable).
*file-upload-hook*
(special variable).
*header-stream*
(special variable).
*hunchentoot-default-external-format*
(special variable).
*hunchentoot-version*
(special variable).
*lisp-errors-log-level*
(special variable).
*lisp-warnings-log-level*
(special variable).
*log-lisp-backtraces-p*
(special variable).
*log-lisp-errors-p*
(special variable).
*log-lisp-warnings-p*
(special variable).
*methods-for-post-parameters*
(special variable).
*reply*
(special variable).
*request*
(special variable).
*rewrite-for-session-urls*
(special variable).
*session*
(special variable).
*session-gc-frequency*
(special variable).
*session-max-time*
(special variable).
*session-secret*
(special variable).
*show-lisp-backtraces-p*
(special variable).
*show-lisp-errors-p*
(special variable).
*tmp-directory*
(special variable).
*use-remote-addr-for-sessions*
(special variable).
*use-user-agent-for-sessions*
(special variable).
+http-accepted+
(constant).
+http-already-reported+
(constant).
+http-authorization-required+
(constant).
+http-bad-gateway+
(constant).
+http-bad-request+
(constant).
+http-client-closed-request+
(constant).
+http-conflict+
(constant).
+http-connection-closed-without-response+
(constant).
+http-continue+
(constant).
+http-created+
(constant).
+http-expectation-failed+
(constant).
+http-failed-dependency+
(constant).
+http-forbidden+
(constant).
+http-gateway-time-out+
(constant).
+http-gone+
(constant).
+http-im-a-teapot+
(constant).
+http-im-used+
(constant).
+http-insufficient-storage+
(constant).
+http-internal-server-error+
(constant).
+http-length-required+
(constant).
+http-locked+
(constant).
+http-loop-detected+
(constant).
+http-method-not-allowed+
(constant).
+http-misdirected-request+
(constant).
+http-moved-permanently+
(constant).
+http-moved-temporarily+
(constant).
+http-multi-status+
(constant).
+http-multiple-choices+
(constant).
+http-network-authentication-required+
(constant).
+http-network-connect-timeout-error+
(constant).
+http-no-content+
(constant).
+http-non-authoritative-information+
(constant).
+http-not-acceptable+
(constant).
+http-not-found+
(constant).
+http-not-implemented+
(constant).
+http-not-modified+
(constant).
+http-ok+
(constant).
+http-partial-content+
(constant).
+http-payment-required+
(constant).
+http-permanent-redirect+
(constant).
+http-precondition-failed+
(constant).
+http-precondition-required+
(constant).
+http-processing+
(constant).
+http-proxy-authentication-required+
(constant).
+http-request-entity-too-large+
(constant).
+http-request-header-fields-too-large+
(constant).
+http-request-time-out+
(constant).
+http-request-uri-too-large+
(constant).
+http-requested-range-not-satisfiable+
(constant).
+http-reset-content+
(constant).
+http-see-other+
(constant).
+http-service-unavailable+
(constant).
+http-switching-protocols+
(constant).
+http-temporary-redirect+
(constant).
+http-too-many-requests+
(constant).
+http-unavailable-for-legal-reasons+
(constant).
+http-unprocessable-entity+
(constant).
+http-unsupported-media-type+
(constant).
+http-upgrade-required+
(constant).
+http-use-proxy+
(constant).
+http-variant-also-negotiates+
(constant).
+http-version-not-supported+
(constant).
abort-request-handler
(function).
accept-connections
(generic function).
acceptor
(class).
acceptor-access-log-destination
(generic reader).
(setf acceptor-access-log-destination)
(generic writer).
acceptor-address
(generic reader).
acceptor-dispatch-request
(generic function).
acceptor-document-root
(generic reader).
(setf acceptor-document-root)
(generic writer).
acceptor-error-template-directory
(generic reader).
(setf acceptor-error-template-directory)
(generic writer).
acceptor-input-chunking-p
(generic reader).
(setf acceptor-input-chunking-p)
(generic writer).
acceptor-listen-backlog
(generic reader).
acceptor-log-access
(generic function).
acceptor-log-message
(generic function).
acceptor-message-log-destination
(generic reader).
(setf acceptor-message-log-destination)
(generic writer).
acceptor-name
(generic reader).
(setf acceptor-name)
(generic writer).
acceptor-output-chunking-p
(generic reader).
(setf acceptor-output-chunking-p)
(generic writer).
acceptor-persistent-connections-p
(generic reader).
(setf acceptor-persistent-connections-p)
(generic writer).
acceptor-port
(generic reader).
acceptor-read-timeout
(generic reader).
acceptor-remove-session
(generic function).
acceptor-reply-class
(generic reader).
(setf acceptor-reply-class)
(generic writer).
acceptor-request-class
(generic reader).
(setf acceptor-request-class)
(generic writer).
acceptor-requests-in-progress
(generic reader).
(setf acceptor-requests-in-progress)
(generic writer).
acceptor-ssl-certificate-file
(generic reader).
acceptor-ssl-p
(generic function).
acceptor-ssl-privatekey-file
(generic reader).
acceptor-ssl-privatekey-password
(generic reader).
acceptor-status-message
(generic function).
acceptor-write-timeout
(generic reader).
authorization
(function).
(setf aux-request-value)
(setf expander).
aux-request-value
(function).
bad-request
(condition).
client-as-string
(function).
content-length
(generic reader).
content-length*
(function).
(setf content-length*)
(function).
content-type
(generic reader).
content-type*
(function).
(setf content-type*)
(function).
cookie-domain
(generic reader).
(setf cookie-domain)
(generic writer).
cookie-expires
(generic reader).
(setf cookie-expires)
(generic writer).
cookie-http-only
(generic reader).
(setf cookie-http-only)
(generic writer).
cookie-in
(function).
cookie-max-age
(generic reader).
(setf cookie-max-age)
(generic writer).
cookie-name
(generic reader).
cookie-out
(function).
cookie-path
(generic reader).
(setf cookie-path)
(generic writer).
cookie-secure
(generic reader).
(setf cookie-secure)
(generic writer).
cookie-value
(generic reader).
(setf cookie-value)
(generic writer).
cookies-in
(generic reader).
cookies-in*
(function).
cookies-out
(generic reader).
(setf cookies-out)
(generic writer).
cookies-out*
(function).
(setf cookies-out*)
(function).
create-folder-dispatcher-and-handler
(function).
create-prefix-dispatcher
(function).
create-regex-dispatcher
(function).
create-request-handler-thread
(generic function).
create-static-file-dispatcher-and-handler
(function).
decrement-taskmaster-thread-count
(generic function).
default-document-directory
(function).
define-easy-handler
(macro).
delete-aux-request-value
(function).
delete-session-value
(function).
detach-socket
(generic function).
dispatch-easy-handlers
(function).
easy-acceptor
(class).
easy-ssl-acceptor
(class).
escape-for-html
(function).
execute-acceptor
(generic function).
get-parameter
(function).
get-parameters
(generic reader).
get-parameters*
(function).
get-peer-ssl-certificate
(function).
handle-if-modified-since
(function).
handle-incoming-connection
(generic function).
handle-request
(generic function).
handle-static-file
(function).
header-in
(generic function).
header-in*
(function).
header-out
(function).
(setf header-out)
(generic function).
headers-in
(generic reader).
headers-in*
(function).
headers-out
(generic reader).
headers-out*
(function).
host
(function).
http-token-p
(function).
hunchentoot-condition
(condition).
hunchentoot-error
(function).
hunchentoot-error
(condition).
hunchentoot-warning
(condition).
increment-taskmaster-thread-count
(generic function).
initialize-connection-stream
(generic function).
local-addr
(generic reader).
local-addr*
(function).
local-port
(generic reader).
local-port*
(function).
log-message*
(function).
maybe-invoke-debugger
(generic function).
mime-type
(function).
multi-threaded-taskmaster
(class).
next-session-id
(generic function).
no-cache
(function).
one-thread-per-connection-taskmaster
(class).
parameter
(function).
parameter-error
(function).
parameter-error
(condition).
post-parameter
(function).
post-parameters
(generic function).
post-parameters*
(function).
process-connection
(generic function).
process-request
(generic function).
query-string
(generic reader).
query-string*
(function).
raw-post-data
(function).
real-remote-addr
(function).
reason-phrase
(function).
recompute-request-parameters
(function).
redirect
(function).
referer
(function).
regenerate-session-cookie-value
(function).
remote-addr
(generic reader).
remote-addr*
(function).
remote-port
(generic reader).
remote-port*
(function).
remove-session
(function).
reply
(class).
reply-external-format
(generic reader).
(setf reply-external-format)
(generic writer).
reply-external-format*
(function).
(setf reply-external-format*)
(function).
request
(class).
request-acceptor
(generic reader).
request-method
(generic reader).
request-method*
(function).
request-pathname
(function).
request-uri
(generic reader).
request-uri*
(function).
require-authorization
(function).
reset-connection-stream
(generic function).
reset-session-secret
(function).
reset-sessions
(function).
return-code
(generic reader).
(setf return-code)
(generic writer).
return-code*
(function).
(setf return-code*)
(function).
rfc-1123-date
(function).
script-name
(generic reader).
script-name*
(function).
send-headers
(function).
server-protocol
(generic reader).
server-protocol*
(function).
session
(generic reader).
(setf session)
(generic writer).
session
(class).
session-cookie-name
(generic function).
session-cookie-value
(generic function).
session-created
(generic function).
session-db
(generic function).
(setf session-db)
(generic function).
session-db-lock
(generic function).
session-gc
(function).
session-id
(generic reader).
session-max-time
(generic reader).
(setf session-max-time)
(generic writer).
session-remote-addr
(generic reader).
session-start
(generic reader).
session-too-old-p
(function).
session-user-agent
(generic reader).
(setf session-value)
(setf expander).
session-value
(function).
session-verify
(generic function).
set-cookie
(function).
set-cookie*
(function).
shutdown
(generic function).
single-threaded-taskmaster
(class).
ssl-acceptor
(class).
ssl-p
(function).
start
(generic function).
start-listening
(generic function).
start-session
(function).
start-thread
(generic function).
started-p
(generic function).
stop
(generic function).
taskmaster
(class).
taskmaster-acceptor
(generic reader).
(setf taskmaster-acceptor)
(generic writer).
taskmaster-max-accept-count
(generic function).
(setf taskmaster-max-accept-count)
(generic writer).
taskmaster-max-thread-count
(generic function).
(setf taskmaster-max-thread-count)
(generic writer).
taskmaster-thread-count
(generic function).
(setf taskmaster-thread-count)
(generic writer).
too-many-taskmaster-requests
(generic function).
url-decode
(function).
url-encode
(function).
user-agent
(function).
within-request-p
(function).
*access-log-lock*
(special variable).
*close-hunchentoot-stream*
(special variable).
*default-max-accept-count*
(special variable).
*default-max-thread-count*
(special variable).
*easy-handler-alist*
(special variable).
*finish-processing-socket*
(special variable).
*global-session-db-lock*
(special variable).
*headers-sent*
(special variable).
*http-reason-phrase-map*
(special variable).
*hunchentoot-stream*
(special variable).
*hyperdoc-base-uri*
(special variable).
*message-log-lock*
(special variable).
*mime-type-hash*
(special variable).
*mime-type-list*
(special variable).
*session-db*
(special variable).
*supports-threads-p*
(symbol macro).
*the-random-state*
(special variable).
*tmp-files*
(special variable).
+buffer-length+
(constant).
+crlf+
(constant).
+day-names+
(constant).
+http-not-extended+
(constant).
+implementation-link+
(constant).
+latin-1+
(constant).
+month-names+
(constant).
+utf-8+
(constant).
+valid-protocol-versions+
(constant).
+valid-request-methods+
(constant).
acceptor-listen-socket
(generic reader).
(setf acceptor-listen-socket)
(generic writer).
acceptor-make-request
(function).
acceptor-process
(generic reader).
(setf acceptor-process)
(generic writer).
acceptor-server-name
(generic function).
acceptor-shutdown-lock
(generic reader).
(setf acceptor-shutdown-lock)
(generic writer).
acceptor-shutdown-p
(generic reader).
(setf acceptor-shutdown-p)
(generic writer).
acceptor-shutdown-queue
(generic reader).
(setf acceptor-shutdown-queue)
(generic writer).
acceptor-taskmaster
(generic reader).
add-cookie-value-to-url
(function).
address-string
(function).
assoc*
(generic function).
aux-data
(generic reader).
(setf aux-data)
(generic writer).
compute-array-parameter
(function).
compute-hash-table-parameter
(function).
compute-list-parameter
(function).
compute-parameter
(function).
compute-real-name
(function).
compute-simple-parameter
(function).
condition-variable-signal
(function).
condition-variable-wait
(function).
content-stream
(generic reader).
convert-hack
(function).
convert-parameter
(function).
cookie
(class).
cookie-date
(function).
cookie-same-site
(generic reader).
(setf cookie-same-site)
(generic writer).
cookies-to-alist
(function).
create-random-string
(function).
decrement-taskmaster-accept-count
(generic function).
def-http-return-code
(macro).
defconstant
(macro).
defvar-unbound
(macro).
do-with-acceptor-request-count-incremented
(function).
encode-session-string
(function).
ensure-parse-integer
(function).
external-format-from-content-type
(function).
form-url-encoded-list-to-alist
(function).
get-backtrace
(function).
get-local-address-and-port
(function).
get-peer-address-and-port
(function).
get-post-data
(function).
get-request-data
(function).
get-stored-session
(function).
handle-incoming-connection%
(generic function).
handler-case*
(macro).
header-out-set-p
(function).
hunchentoot-operation-not-implemented-operation
(generic reader).
hunchentoot-simple-error
(condition).
hunchentoot-simple-warning
(condition).
hunchentoot-warn
(function).
hyperdoc-lookup
(function).
ignore-errors*
(macro).
increment-taskmaster-accept-count
(generic function).
input-chunking-p
(function).
iso-time
(function).
keep-alive-p
(function).
make-condition-variable
(function).
make-cooked-message
(function).
make-defun-parameter
(function).
make-lock
(function).
make-socket-stream
(function).
make-tmp-file-name
(function).
maybe-add-charset-to-content-type-header
(function).
maybe-handle-range-header
(function).
maybe-read-post-parameters
(function).
maybe-rewrite-urls-for-session
(function).
md5-hex
(function).
not-implemented
(function).
note-free-connection
(generic function).
operation-not-implemented
(condition).
parse-content-type
(function).
parse-multipart-form-data
(function).
parse-path
(function).
parse-rfc2388-form-data
(function).
printable-ascii-char-p
(function).
quote-string
(function).
read-initial-request-line
(function).
scanner-for-get-param
(function).
send-bad-request-response
(function).
send-response
(function).
send-service-unavailable-reply
(function).
send-unknown-protocol-response
(function).
session-data
(generic reader).
session-last-click
(generic reader).
session-string
(generic reader).
set-timeouts
(function).
start-output
(function).
starts-with-one-of-p
(function).
starts-with-p
(function).
string-as-keyword
(function).
stringify-cookie
(generic function).
stringify-session
(function).
taskmaster-accept-count
(generic reader).
(setf taskmaster-accept-count)
(generic writer).
taskmaster-accept-count-lock
(generic reader).
taskmaster-thread-count-lock
(generic reader).
taskmaster-wait-lock
(generic reader).
taskmaster-wait-queue
(generic reader).
taskmaster-worker-thread-name-format
(generic reader).
(setf taskmaster-worker-thread-name-format)
(generic writer).
upgrade-vector
(macro).
wait-for-free-connection
(generic function).
wake-acceptor-for-shutdown
(function).
with-acceptor-request-count-incremented
(macro).
with-conditions-caught-and-logged
(macro).
with-debugger
(macro).
with-lock-held
(macro).
with-log-stream
(macro).
with-mapped-conditions
(macro).
with-session-lock-held
(macro).
write-header-line
(generic function).
url-rewrite
common-lisp
.
*url-rewrite-fill-tags*
(special variable).
*url-rewrite-tags*
(special variable).
add-get-param-to-url
(function).
rewrite-urls
(function).
starts-with-scheme-p
(function).
url-encode
(function).
*find-string-hash*
(special variable).
*hyperdoc-base-uri*
(special variable).
comment-start-p
(function).
hyperdoc-lookup
(function).
letterp
(function).
name-char-p
(function).
peek-char*
(function).
read-attribute
(function).
read-delimited-string
(function).
read-name
(function).
read-until
(function).
read-while
(function).
skip-comment
(function).
skip-whitespace
(function).
whitespacep
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
HTTP return code (202) for ’Accepted’.
HTTP return code (208) for ’Already Reported’.
HTTP return code (401) for ’Authorization Required’.
HTTP return code (502) for ’Bad Gateway’.
HTTP return code (400) for ’Bad Request’.
HTTP return code (499) for ’Client Closed Request’.
HTTP return code (409) for ’Conflict’.
HTTP return code (444) for ’Connection Closed Without Response’.
HTTP return code (100) for ’Continue’.
HTTP return code (201) for ’Created’.
HTTP return code (417) for ’Expectation Failed’.
HTTP return code (424) for ’Failed Dependency’.
HTTP return code (403) for ’Forbidden’.
HTTP return code (504) for ’Gateway Time-out’.
HTTP return code (410) for ’Gone’.
HTTP return code (418) for ’I’m a teapot’.
HTTP return code (226) for ’IM Used’.
HTTP return code (507) for ’Insufficient Storage’.
HTTP return code (500) for ’Internal Server Error’.
HTTP return code (411) for ’Length Required’.
HTTP return code (423) for ’Locked’.
HTTP return code (508) for ’Loop Detected’.
HTTP return code (405) for ’Method Not Allowed’.
HTTP return code (421) for ’Misdirected Request’.
HTTP return code (301) for ’Moved Permanently’.
HTTP return code (302) for ’Moved Temporarily’.
HTTP return code (207) for ’Multi-Status’.
HTTP return code (300) for ’Multiple Choices’.
HTTP return code (511) for ’Network Authentication Required’.
HTTP return code (599) for ’Network Connect Timeout Error’.
HTTP return code (204) for ’No Content’.
HTTP return code (203) for ’Non-Authoritative Information’.
HTTP return code (406) for ’Not Acceptable’.
HTTP return code (404) for ’Not Found’.
HTTP return code (501) for ’Not Implemented’.
HTTP return code (304) for ’Not Modified’.
HTTP return code (200) for ’OK’.
HTTP return code (206) for ’Partial Content’.
HTTP return code (402) for ’Payment Required’.
HTTP return code (308) for ’Permanent Redirect’.
HTTP return code (412) for ’Precondition Failed’.
HTTP return code (428) for ’Precondition Required’.
HTTP return code (102) for ’Processing’.
HTTP return code (407) for ’Proxy Authentication Required’.
HTTP return code (413) for ’Request Entity Too Large’.
HTTP return code (431) for ’Request Header Fields Too Large’.
HTTP return code (408) for ’Request Time-out’.
HTTP return code (414) for ’Request-URI Too Large’.
HTTP return code (416) for ’Requested range not satisfiable’.
HTTP return code (205) for ’Reset Content’.
HTTP return code (303) for ’See Other’.
HTTP return code (101) for ’Switching Protocols’.
HTTP return code (307) for ’Temporary Redirect’.
HTTP return code (429) for ’Too Many Requests’.
HTTP return code (422) for ’Unprocessable Entity’.
HTTP return code (415) for ’Unsupported Media Type’.
HTTP return code (426) for ’Upgrade Required’.
HTTP return code (305) for ’Use Proxy’.
HTTP return code (506) for ’Variant Also Negotiates’.
HTTP return code (505) for ’Version not supported’.
The current ACCEPTOR object while in the context of a request.
Whether Hunchentoot should catch and log errors (or rather invoke the debugger).
The content types for which url-rewriting is OK. See *REWRITE-FOR-SESSION-URLS*.
The default connection timeout used when an acceptor is reading from and writing to a socket stream.
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.
A global list of dispatch functions.
If this is not NIL, it should be a unary function which will be called with a pathname for each file which is uploaded to Hunchentoot. The pathname denotes the temporary file to which the uploaded file is written. The hook is called directly before the file is created.
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.
The external format used to compute the REQUEST object.
Log level for Lisp errors. Should be one of :ERROR (the default), :WARNING, or :INFO.
Log level for Lisp warnings. Should be one of :ERROR, :WARNING (the default), or :INFO.
Whether Lisp backtraces should be logged. Only has an effect if *LOG-LISP-ERRORS-P* is true as well.
Whether Lisp errors in request handlers should be logged.
Whether Lisp warnings in request handlers should be logged.
A list of the request method types (as keywords) for which Hunchentoot will try to compute POST-PARAMETERS.
The current REPLY object while in the context of a request.
The current REQUEST object while in the context of a request.
Whether HTML pages should possibly be rewritten for cookie-less session-management.
The current session while in the context of a request, or NIL.
A session GC (see function SESSION-GC) will happen every *SESSION-GC-FREQUENCY* requests (counting only requests which create a new session) if this variable is not NIL. See SESSION-CREATED.
The default time (in seconds) after which a session times out.
A random ASCII string that’s used to encode the public session data. This variable is initially unbound and will be set (using RESET-SESSION-SECRET) the first time a session is created, if necessary. You can prevent this from happening if you set the value yourself before starting acceptors.
Whether Lisp errors shown in HTML output should contain backtrace information.
Whether Lisp errors in request handlers should be shown in HTML output.
Directory for temporary files created by MAKE-TMP-FILE-NAME.
The tag/attribute combinations where URL-rewriting should optionally add an attribute.
The tag/attribute combinations where URL-rewriting should happen.
Whether the client’s remote IP (as returned by REAL-REMOTE-ADDR) should be encoded into the session string. If this value is true, a session will cease to be accessible if the client’s remote IP changes.
This might for example be an issue if the client uses a proxy server which doesn’t send correct ’X_FORWARDED_FOR’ headers.
Whether the ’User-Agent’ header should be encoded into the session string. If this value is true, a session will cease to be accessible if the client sends a different ’User-Agent’ header.
Defines a handler with the body BODY and optionally registers
it with a URI so that it will be found by DISPATCH-EASY-HANDLERS.
DESCRIPTION is either a symbol NAME or a list matching the
destructuring lambda list
(name &key uri acceptor-names host
default-parameter-type default-request-type).
LAMBDA-LIST is a list the elements of which are either a symbol
VAR or a list matching the destructuring lambda list
(var &key real-name parameter-type init-form request-type).
The resulting handler will be a Lisp function with the name NAME
and keyword parameters named by the VAR symbols. Each VAR will
be bound to the value of the GET or POST parameter called
REAL-NAME (a string) before BODY is executed. If REAL-NAME is
not provided, it will be computed by downcasing the symbol name
of VAR.
If URI (which is evaluated) is provided, then it must be a string or
a function designator for a function of one argument. In this case,
the handler will be returned by DISPATCH-EASY-HANDLERS, if URI is a
string and the script name of a request is URI, or if URI designates a
function and applying this function to the current request object
returns a true value.
HOST, if given, is compared to the given host as well
(don’t forget the port number).
ACCEPTOR-NAMES (which is evaluated) can be a list of symbols which
means that the handler will be returned by DISPATCH-EASY-HANDLERS in
acceptors which have one of these names (see ACCEPTOR-NAME).
ACCEPTOR-NAMES can also be the symbol T which means that the handler
will be returned by DISPATCH-EASY-HANDLERS in every acceptor.
Whether the GET or POST parameter (or both) will be taken into
consideration, depends on REQUEST-TYPE which can
be :GET, :POST, :BOTH, or NIL. In the last case, the value of
DEFAULT-REQUEST-TYPE (the default of which is :BOTH) will be
used.
The value of VAR will usually be a string (unless it resulted from a
file upload in which case it won’t be converted at all), but if
PARAMETER-TYPE (which is evaluated) is provided, the string will be
converted to another Lisp type by the following rules:
If the corresponding GET or POST parameter wasn’t provided by the client, VAR’s value will be NIL. If PARAMETER-TYPE is ’STRING, VAR’s value remains as is. If PARAMETER-TYPE is ’INTEGER and the parameter string consists solely of decimal digits, VAR’s value will be the corresponding integer, otherwise NIL. If PARAMETER-TYPE is ’KEYWORD, VAR’s value will be the keyword obtained by interning the upcased parameter string into the keyword package. If PARAMETER-TYPE is ’CHARACTER and the parameter string is of length one, VAR’s value will be the single character of this string, otherwise NIL. If PARAMETER-TYPE is ’BOOLEAN, VAR’s value will always be T (unless it is NIL by the first rule above, of course). If PARAMETER-TYPE is any other atom, it is supposed to be a function designator for a unary function which will be called to convert the string to something else.
Those were the rules for ‘simple’ types, but PARAMETER-TYPE can
also be a list starting with one of the symbols LIST, ARRAY, or
HASH-TABLE. The second value of the list must always be a simple
parameter type as in the last paragraph - we’ll call it the
‘inner type’ below.
In the case of ’LIST, all GET/POST parameters called REAL-NAME
will be collected, converted to the inner type, and assembled
into a list which will be the value of VAR.
In the case of ’ARRAY, all GET/POST parameters which have a name
like the result of
(format nil "~A[~A]" real-name n)
where N is a non-negative integer, will be assembled into an
array where the Nth element will be set accordingly, after
conversion to the inner type. The array, which will become the
value of VAR, will be big enough to hold all matching parameters,
but not bigger. Array elements not set as described above will
be NIL. Note that VAR will always be bound to an array, which
may be empty, so it will never be NIL, even if no appropriate
GET/POST parameters are found.
The full form of a ’HASH-TABLE parameter type is
(hash-table inner-type key-type test-function),
but KEY-TYPE and TEST-FUNCTION can be left out in which case they
default to ’STRING and ’EQUAL, respectively. For this parameter
type, all GET/POST parameters which have a name like the result
of
(format nil "~A{~A}" real-name key)
(where KEY is a string that doesn’t contain curly brackets) will
become the values (after conversion to INNER-TYPE) of a hash
table with test function TEST-FUNCTION where KEY (after
conversion to KEY-TYPE) will be the corresponding key. Note that
VAR will always be bound to a hash table, which may be empty, so
it will never be NIL, even if no appropriate GET/POST parameters
are found.
To make matters even more complicated, the three compound
parameter types also have an abbreviated form - just one of the
symbols LIST, ARRAY, or HASH-TABLE. In this case, the inner type
will default to ’STRING.
If PARAMETER-TYPE is not provided or NIL, DEFAULT-PARAMETER-TYPE
(the default of which is ’STRING) will be used instead.
If the result of the computations above would be that VAR would
be bound to NIL, then INIT-FORM (if provided) will be evaluated
instead, and VAR will be bound to the result of this evaluation.
Handlers built with this macro are constructed in such a way that
the resulting Lisp function is useful even outside of
Hunchentoot. Specifically, all the parameter computations above
will only happen if *REQUEST* is bound, i.e. if we’re within a
Hunchentoot request. Otherwise, VAR will always be bound to the
result of evaluating INIT-FORM unless a corresponding keyword
argument is provided.
Sets the value associated with SYMBOL from the request object REQUEST (default is *REQUEST*). If there is already a value associated with SYMBOL it will be replaced.
aux-request-value
(function).
Sets the value associated with SYMBOL from the session object SESSION. If there is already a value associated with SYMBOL it will be replaced. Will automatically start a session if none was supplied and there’s no session for the current request.
session-value
(function).
This function can be called by a request handler at any time to immediately abort handling the request. This works as if the handler had returned RESULT. See the source code of REDIRECT for an example.
URL is assumed to be a http URL. The pair of NAME and VALUE will be added as a GET parameter to this URL. Assumes that there’s no other parameter of the same name. Only checks if #? is part of the string to decide how to attach the new parameter to the end of the string.
Returns as two values the user and password (if any) as encoded in the ’AUTHORIZATION’ header. Returns NIL if there is no such header.
Returns the value associated with SYMBOL from the request object REQUEST (the default is the current request) if it exists. The second return value is true if such a value was found.
A helper function which returns the client’s address and port as a string and tries to act robustly in the presence of network problems.
The outgoing ’Content-Length’ http header of REPLY.
Sets the outgoing ’Content-Length’ http header of REPLY.
The outgoing ’Content-Type’ http header of REPLY.
Sets the outgoing ’Content-Type’ http header of REPLY.
Returns the cookie with the name NAME (a string) as sent by the browser - or NIL if there is none.
Returns the current value of the outgoing cookie named NAME. Search is case-sensitive.
Returns an alist of all cookies associated with the REQUEST object REQUEST.
Returns an alist of the outgoing cookies associated with the REPLY object REPLY.
Sets the alist of the outgoing cookies associated with the REPLY object REPLY.
Creates and returns a dispatch function which will dispatch to a
handler function which emits the file relative to BASE-PATH that is
denoted by the URI of the request relative to URI-PREFIX. URI-PREFIX
must be a string ending with a slash, BASE-PATH must be a pathname
designator for an existing directory. If CONTENT-TYPE is not NIL,
it’ll be the content type used for all files in the folder.
See HANDLE-STATIC-FILE for CALLBACK.
Creates a request dispatch function which will dispatch to the function denoted by HANDLER if the file name of the current request starts with the string PREFIX.
Creates a request dispatch function which will dispatch to the function denoted by HANDLER if the file name of the current request matches the CL-PPCRE regular expression REGEX.
Creates and returns a request dispatch function which will dispatch
to a handler function which emits the file denoted by the pathname
designator PATH with content type CONTENT-TYPE if the SCRIPT-NAME of
the request matches the string URI. If CONTENT-TYPE is NIL, tries to
determine the content type via the file’s suffix.
See HANDLE-STATIC-FILE for CALLBACK.
Removes the value associated with SYMBOL from the request object REQUEST.
Removes the value associated with SYMBOL from SESSION if there is one.
This is a dispatcher which returns the appropriate handler defined with DEFINE-EASY-HANDLER, if there is one.
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.
Returns an alist of the GET parameters associated with the REQUEST object REQUEST.
Handles the ’If-Modified-Since’ header of REQUEST. The date string is compared to the one generated from the supplied universal time TIME.
A function which acts like a Hunchentoot handler for 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 suffix of the file.
CALLBACK is run just before sending the file, and can be used
to set headers or check authorization;
arguments are the filename and the (guessed) content-type.
Returns the incoming header with name NAME. NAME can be a keyword (recommended) or a string.
Returns the current value of the outgoing http header named NAME. NAME should be a keyword or a string.
Returns an alist of the incoming headers associated with the REQUEST object REQUEST.
Returns an alist of the outgoing headers associated with the REPLY object REPLY.
Returns the ’Host’ incoming http header value.
This function tests whether OBJECT is a non-empty string which is a TOKEN according to RFC 2068 (i.e. whether it may be used for, say, cookie names).
Signals an error of type HUNCHENTOOT-SIMPLE-ERROR with the provided format control and arguments.
Returns the address the current request connected to.
Returns the port the current request connected to.
Convenience function which calls the message logger of the current
acceptor (if there is one) with the same arguments it accepts.
This is the function which Hunchentoot itself uses to log errors it catches during request processing.
Given a pathname designator PATHSPEC returns the MIME type (as a string) corresponding to the suffix of the file denoted by PATHSPEC (or NIL).
Adds appropriate 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.
Signals an error of type PARAMETER-ERROR with the provided format control and arguments.
Returns the POST parameter with name NAME (a string) - or NIL if there is none. Search is case-sensitive.
Returns an alist of the POST parameters associated with the REQUEST object REQUEST.
Returns the query string of the REQUEST object REQUEST. That’s the part behind the question mark (i.e. the GET parameters).
Returns the content sent by the client if there was any (unless
the content type was "multipart/form-data"). By default, the result
is a string if the type of the ‘Content-Type’ media type is "text",
and a vector of octets otherwise. In the case of a string, the
external format to be used to decode the content will be determined
from the ‘charset’ parameter sent by the client (or otherwise
*HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT* will be used).
You can also provide an external format explicitly (through
EXTERNAL-FORMAT) in which case the result will unconditionally be a
string. Likewise, you can provide a true value for FORCE-TEXT which
will force Hunchentoot to act as if the type of the media type had
been "text". Or you can provide a true value for FORCE-BINARY which
means that you want a vector of octets at any rate.
If, however, you provide a true value for WANT-STREAM, the other
parameters are ignored and you’ll get the content (flexi) stream to
read from it yourself. It is then your responsibility to read the
correct amount of data, because otherwise you won’t be able to return
a response to the client. If the content type of the request was
‘multipart/form-data’ or ‘application/x-www-form-urlencoded’, the
content has been read by Hunchentoot already and you can’t read from
the stream anymore.
You can call RAW-POST-DATA more than once per request, but you can’t
mix calls which have different values for WANT-STREAM.
Note that this function is slightly misnamed because a client can send content even if the request method is not POST.
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 RETURN-CODE (which should be an integer) or NIL for return codes Hunchentoot doesn’t know.
Recomputes the GET and POST parameters for the REQUEST object REQUEST. This only makes sense if you’re switching external formats during the request.
Redirects the browser to TARGET which should be a string. 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, PROTOCOL must be one of the keywords :HTTP or :HTTPS, and the URL to redirect to will be constructed from HOST, PORT, PROTOCOL, and TARGET. Adds a session ID if ADD-SESSION-ID is true. If CODE is a 3xx redirection code, it will be sent as status code.
Returns the ’Referer’ (sic!) http header.
Regenerates the cookie value. This should be used
when a user logs in according to the application to prevent against
session fixation attacks. The cookie value being dependent on ID,
USER-AGENT, REMOTE-ADDR, START, and *SESSION-SECRET*, the only value
we can change is START to regenerate a new value. Since we’re
generating a new cookie, it makes sense to have the session being
restarted, in time. That said, because of this fact, calling this
function twice in the same second will regenerate twice the same value.
Returns the address the current request originated from.
Returns the port the current request originated from.
Completely removes the SESSION object SESSION from Hunchentoot’s internal session database.
The external format of REPLY which is used for character output.
Sets the external format of REPLY.
Returns the request method as a Lisp keyword.
Construct a relative pathname from the request’s SCRIPT-NAME.
If DROP-PREFIX is given, pathname construction starts at the first path
segment after the prefix.
Returns the request URI.
Sends back appropriate headers to require basic HTTP authentication (see RFC 2617) for the realm REALM.
Sets *SESSION-SECRET* to a new random value. All old sessions will cease to be valid.
Removes ALL stored sessions of ACCEPTOR.
The http return code of REPLY. The return codes Hunchentoot can handle are defined in specials.lisp.
Sets the http return code of REPLY.
Reads an (X)HTML document from *STANDARD-INPUT* and writes it back
to *STANDARD-OUTPUT*. Any attribute value which is in one of the
positions denoted by *URL-REWRITE-TAGS* is rewritten by REWRITE-FN if
it passes the test denoted by the optional function TEST-FN which
defaults to the complement of STARTS-WITH-SCHEME-P.
This function aims to yield correct results for correct (X)HTML input and it also tries hard to never signal an error although it may warn if it encounters syntax errors. It will NOT detect any possible error nor is there any warranty that it will work correctly with faulty input.
Generates a time string according to RFC 1123. Default is current time. This can be used to send a ’Last-Modified’ header - see HANDLE-IF-MODIFIED-SINCE.
Returns the file name of the REQUEST object REQUEST. That’s the requested URI without the query string (i.e the GET parameters).
Sends the initial status line and all headers as determined by the
REPLY object *REPLY*. Returns a binary stream to which the body of
the reply can be written. Once this function has been called, further
changes to *REPLY* don’t have any effect. Also, automatic handling of
errors (i.e. sending the corresponding status code to the browser,
etc.) is turned off for this request. If your handlers return the
full body as a string or as an array of octets you should NOT call
this function.
This function does not return control to the caller during HEAD request processing.
Returns the request protocol as a Lisp keyword.
Removes sessions from the current session database which are too old - see SESSION-TOO-OLD-P.
Returns true if the SESSION object SESSION has not been active in the last (SESSION-MAX-TIME SESSION) seconds.
Returns the value associated with SYMBOL from the session object SESSION (the default is the current session) if it exists.
Creates a cookie object from the parameters provided and adds it to the outgoing cookies of the REPLY object REPLY. If a cookie with the name NAME (case-sensitive) already exists, it is replaced.
Adds the COOKIE object COOKIE to the outgoing cookies of the REPLY object REPLY. If a cookie with the same name (case-sensitive) already exists, it is replaced.
Whether the current connection to the client is secure. See ACCEPTOR-SSL-P.
Returns the current SESSION object. If there is no current session, creates one and updates the corresponding data structures. In this case the function will also send a session cookie to the browser.
Checks whether the string STRING represents a URL which starts with a scheme, i.e. something like ’https://’ or ’mailto:’.
Decodes a URL-encoded string which is assumed to be encoded using the external format EXTERNAL-FORMAT, i.e. this is the inverse of URL-ENCODE. It is assumed that you’ll rarely need this function, if ever. But just in case - here it is. The default for EXTERNAL-FORMAT is the value of *HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT*.
URL-encodes a string using the external format EXTERNAL-FORMAT. The default for EXTERNAL-FORMAT is the value of *HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT*.
URL-encode a string.
Returns the ’User-Agent’ http header.
True if we’re in the context of a request, otherwise nil.
In a loop, accepts a connection and hands it over
to the acceptor’s taskmaster for processing using
HANDLE-INCOMING-CONNECTION. On LispWorks, this function returns
immediately, on other Lisps it returns only once the acceptor has been
stopped.
acceptor
)) ¶acceptor
)) ¶Destination of the access log
which contains one log entry per request handled in a format similar
to Apache’s access.log. Can be set to a pathname or string
designating the log file, to a open output stream or to NIL to
suppress logging.
acceptor
)) ¶The address the acceptor is listening on.
If address is a string denoting an IP address, then the server only
receives connections for that address. This must be one of the
addresses associated with the machine and allowed values are host
names such as "www.zappa.com" and address strings such as
"72.3.247.29". If address is NIL, then the server will receive
connections to all IP addresses on the machine. This is the default.
This function is called to actually dispatch the
request once the standard logging and error handling has been set up.
ACCEPTOR subclasses implement methods for this function in order to
perform their own request routing. If a method does not want to
handle the request, it is supposed to invoke CALL-NEXT-METHOD so that
the next ACCEPTOR in the inheritance chain gets a chance to handle the
request.
easy-acceptor
) request) ¶The easy request dispatcher which selects a request handler based on a list of individual request dispatchers all of which can either return a handler or neglect by returning NIL.
acceptor
)) ¶acceptor
)) ¶Directory pathname that
contains error message template files for server-generated error
messages. Files must be named <return-code>.html with <return-code>
representing the HTTP return code that the file applies to,
i.e. 404.html would be used as the content for a HTTP 404 Not found
response. Set *SHOW-LISP-ERRORS-P* to T for this setting to work.
acceptor
)) ¶acceptor
)) ¶A generalized boolean denoting
whether the acceptor may use chunked encoding for input, i.e. when
accepting request bodies from the client. The default is T and
there’s usually no reason to change this to NIL.
Function to call to log access to the acceptor. The RETURN-CODE, CONTENT and CONTENT-LENGTH keyword arguments contain additional information about the request to log. In addition, it can use the standard request accessor functions that are available to handler functions to find out more information about the request.
Function to call to log messages by the ACCEPTOR. It must accept a severity level for the message, which will be one of :ERROR, :INFO, or :WARNING, a format string and an arbitary number of formatting arguments.
acceptor
) log-level format-string &rest format-arguments) ¶Default function to log server messages. Sends a formatted message to the destination denoted by (ACCEPTOR-MESSAGE-LOG-DESTINATION ACCEPTOR). FORMAT and ARGS are as in FORMAT. LOG-LEVEL is a keyword denoting the log level or NIL in which case it is ignored.
acceptor
)) ¶acceptor
)) ¶Destination of the server
error log which is used to log informational, warning and error
messages in a free-text format intended for human inspection. Can be
set to a pathname or string designating the log file, to a open output
stream or to NIL to suppress logging.
acceptor
)) ¶acceptor
)) ¶The optional name of the acceptor, a symbol.
This name can be utilized when defining "easy handlers" - see
DEFINE-EASY-HANDLER. The default name is an uninterned symbol as
returned by GENSYM.
name
.
acceptor
)) ¶acceptor
)) ¶A generalized boolean denoting
whether the acceptor may use chunked encoding for output, i.e. when
sending data to the client. The default is T and there’s usually no
reason to change this to NIL.
acceptor
)) ¶acceptor
)) ¶A generalized boolean
denoting whether the acceptor supports persistent connections, which
is the default for threaded acceptors. If this property is NIL,
Hunchentoot closes each incoming connection after having processed one
request. This is the default for non-threaded acceptors.
acceptor
)) ¶The port the acceptor is listening on. The
default is 80. Note that depending on your operating system you might
need special privileges to listen on port 80. When 0, the port will be
chosen by the system the first time the acceptor is started.
port
.
This function is called whenever a session in ACCEPTOR is being destroyed because of a session timout or an explicit REMOVE-SESSION call.
acceptor
)) ¶acceptor
)) ¶Determines which class of reply
objects is created when a request is served in and should be (a
symbol naming) a class which inherits from REPLY. The default is the
symbol REPLY.
acceptor
)) ¶acceptor
)) ¶Determines which class of request
objects is created when a request comes in and should be (a symbol
naming) a class which inherits from REQUEST. The default is the
symbol REQUEST.
ssl-acceptor
)) ¶A pathname designator for a certificate file in PEM format.
Returns a true value if ACCEPTOR uses SSL
connections. The default is to unconditionally return NIL and
subclasses of ACCEPTOR must specialize this method to signal that
they’re using secure connections - see the SSL-ACCEPTOR class.
ssl-acceptor
)) ¶ssl-acceptor
)) ¶A pathname designator for a
private key file in PEM format, or (only on LispWorks) NIL if the
certificate file contains the private key.
ssl-acceptor
)) ¶The password for the
private key file or NIL for no password.
This function is called after the request’s handler has been
invoked to convert the HTTP-STATUS-CODE to a HTML message to be
displayed to the user. If this function returns a string, that
string is sent to the client instead of the content produced by the
handler, if any.
If an ERROR-TEMPLATE-DIRECTORY is set in the current acceptor and
the directory contains a file corresponding to HTTP-STATUS-CODE
named <code>.html, that file is sent to the client after variable
substitution. Variables are referenced by ${<variable-name>}.
Additional keyword arguments may be provided which are made
available to the templating logic as substitution variables. These
variables can be interpolated into error message templates in,
which contains the current URL relative to the server and without
GET parameters.
In addition to the variables corresponding to keyword arguments, the script-name, lisp-implementation-type, lisp-implementation-version and hunchentoot-version variables are available.
acceptor
) http-status-code &rest properties &key &allow-other-keys) ¶Default function to generate error message sent to the client.
acceptor
) http-status-code &rest args &key &allow-other-keys) ¶cookie
)) ¶cookie
)) ¶A generalized boolean denoting whether
this cookie is a ‘HttpOnly’ cookie.
This is a Microsoft extension that has been implemented in Firefox as well. See <http://msdn2.microsoft.com/en-us/library/ms533046.aspx>.
Create a new thread in which to process the request.
This thread will call PROCESS-CONNECTION to process the request.
one-thread-per-connection-taskmaster
) socket) ¶Create a thread for handling a single request
Atomically decrement the number of taskmaster requests
one-thread-per-connection-taskmaster
)) ¶taskmaster
)) ¶Default method – do nothing.
Indicate to Hunchentoot that it should stop serving
requests on the current request’s socket.
Hunchentoot will finish processing the current
request and then return from PROCESS-CONNECTION
without closing the connection to the client.
DETACH-SOCKET can only be called from within a
request handler function.
This is a callback called by the acceptor once it
has performed all initial processing to start listening for incoming
connections (see START-LISTENING). It usually calls the
ACCEPT-CONNECTIONS method of the acceptor, but depending on the
taskmaster instance the method might be called from a new thread.
multi-threaded-taskmaster
)) ¶single-threaded-taskmaster
)) ¶This function is called by the acceptor to start
processing of requests on a new incoming connection. SOCKET is the
usocket instance that represents the new connection (or a socket
handle on LispWorks). The taskmaster starts processing requests on
the incoming connection by calling the PROCESS-CONNECTION method of
the acceptor instance. The SOCKET argument is passed to
PROCESS-CONNECTION as an argument.
one-thread-per-connection-taskmaster
) socket) ¶single-threaded-taskmaster
) socket) ¶This function is called once the request has been
read and a REQUEST object has been created. Its job is to set up
standard error handling and request logging.
Might be a good place for around methods specialized for your subclass of ACCEPTOR which bind or rebind special variables which can then be accessed by your handlers.
Returns the incoming header with name NAME. NAME can be a keyword (recommended) or a string.
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.
symbol
) &optional reply) ¶string
) &optional reply) ¶If NAME is a string, it is converted to a keyword first.
(eql :content-length)
) &optional reply) ¶Special case for the ‘Content-Length’ header.
(eql :content-type)
) &optional reply) ¶Special case for the ‘Content-Type’ header.
Atomically increment the number of taskmaster requests.
one-thread-per-connection-taskmaster
)) ¶taskmaster
)) ¶Default method – do nothing.
Can be used to modify the stream which is used to
communicate between client and server before the request is read. The
default method of ACCEPTOR does nothing, but see for example the
method defined for SSL-ACCEPTOR. All methods of this generic function
must return the stream to use.
ssl-acceptor
) stream) ¶This generic function is called whenever a
condition CONDITION is signaled in Hunchentoot. 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.
Returns the next sequential session ID, an integer,
which should be unique per session. The default method uses a simple
global counter and isn’t guarded by a lock. For a high-performance
production environment you might consider using a more robust
implementation.
This function is called by the taskmaster when a
new client connection has been established. Its arguments are the
ACCEPTOR object and a LispWorks socket handle or a usocket socket
stream object in SOCKET. It reads the request headers, sets up the
request and reply objects, and hands over to PROCESS-REQUEST. This is
done in a loop until the stream has to be closed or until a connection
timeout occurs.
It is probably not a good idea to re-implement this method until you really, really know what you’re doing.
This function is called by PROCESS-CONNECTION after
the incoming headers have been read. It calls HANDLE-REQUEST to
select and call a handler and sends the output of this handler to the
client using START-OUTPUT. Note that PROCESS-CONNECTION is called
once per connection and loops in case of a persistent connection while
PROCESS-REQUEST is called anew for each request.
Essentially, you can view process-request as a thin wrapper around
HANDLE-REQUEST.
The return value of this function is ignored.
Standard implementation for processing a request.
Resets the stream which is used to communicate
between client and server after one request has been served so that it
can be used to process the next request. This generic function is
called after a request has been processed and must return the
stream.
Returns the name (a string) of the cookie (or the
GET parameter) which is used to store a session on the client side.
The default is to use the string "hunchentoot-session", but you can
specialize this function if you want another name.
Returns a string which can be used to safely
restore the session SESSION if as session has already been
established. This is used as the value stored in the session cookie
or in the corresponding GET parameter and verified by SESSION-VERIFY.
A default method is provided and there’s no reason to change it unless you want to use your own session objects.
This function is called whenever a new session has
been created. There’s a default method which might trigger a session
GC based on the value of *SESSION-GC-FREQUENCY*.
The return value is ignored.
Counts session usage globally and triggers session GC if necessary.
Returns the current session database which is an
alist where each car is a session’s ID and the cdr is the
corresponding SESSION object itself. The default is to use a global
list for all acceptors.
Modifies the current session database. See SESSION-DB.
A function which returns a lock that will be used
to prevent concurrent access to sessions. The first argument will be
the acceptor that handles the current request, the second argument is
true if the whole (current) session database is modified. If it is
NIL, only one existing session in the database is modified.
This function can return NIL which means that sessions or session databases will be modified without a lock held (for example for single-threaded environments). The default is to always return a global lock (ignoring the ACCEPTOR argument) for Lisps that support threads and NIL otherwise.
Tries to get a session identifier from the cookies
(or alternatively from the GET parameters) sent by the client (see
SESSION-COOKIE-NAME and SESSION-COOKIE-VALUE). This identifier is
then checked for validity against the REQUEST object REQUEST. On
success the corresponding session object (if not too old) is returned
(and updated). Otherwise NIL is returned.
A default method is provided and you only need to write your own one if you want to maintain your own sessions.
Shuts down the taskmaster, i.e. frees all resources
that were set up by it. For example, a multi-threaded taskmaster
might terminate all threads that are currently associated with it.
This function is called by the acceptor’s STOP method.
one-thread-per-connection-taskmaster
)) ¶taskmaster
)) ¶Starts the ACCEPTOR so that it begins accepting connections. Returns the acceptor.
Sets up a listen socket for the given ACCEPTOR and
enables it to listen to incoming connections. This function is called
from the thread that starts the acceptor initially and may return
errors resulting from the listening operation (like ’address in use’
or similar).
Start a name thread in which to call the THUNK, in the context of the given TASKMASTER.
Keyword arguments provide TASKMASTER-dependent options.
Return a thread object.
Hunchentoot taskmaster methods will call it with the taskmaster as the context,
allowing hunchentoot extensions to define specialized methods that may e.g.
wrap the thunk within a proper set of bindings and condition handlers.
Tells if ACCEPTOR has been started.
The default implementation simply queries ACCEPTOR for its listening
status, so if T is returned to the calling thread, then some thread
has called START or some thread’s call to STOP hasn’t finished. If NIL
is returned either some thread has called STOP, or some thread’s call
to START hasn’t finished or START was never called at all for
ACCEPTOR.
Stops the ACCEPTOR so that it no longer accepts
requests. If SOFT is true, and there are any requests in progress,
wait until all requests are fully processed, but meanwhile do not
accept new requests. Note that SOFT must not be set when calling
STOP from within a request handler, as that will deadlock.
taskmaster
)) ¶taskmaster
)) ¶A backpointer to the acceptor instance this taskmaster works for.
The maximum number of connections this taskmaster will accept before refusing new connections. If supplied, this must be greater than MAX-THREAD-COUNT. The number of queued requests is the difference between MAX-ACCEPT-COUNT and MAX-THREAD-COUNT.
one-thread-per-connection-taskmaster
)) ¶The maximum number of connections this taskmaster will accept before refusing new connections. If supplied, this must be greater than MAX-THREAD-COUNT. The number of queued requests is the difference between MAX-ACCEPT-COUNT and MAX-THREAD-COUNT.
taskmaster
)) ¶Default method – no limit on the number of connections.
one-thread-per-connection-taskmaster
)) ¶The maximum number of connections this taskmaster will accept before refusing new connections. If supplied, this must be greater than MAX-THREAD-COUNT. The number of queued requests is the difference between MAX-ACCEPT-COUNT and MAX-THREAD-COUNT.
The maximum number of request threads this taskmaster will simultaneously run before refusing or queueing new connections requests. If the value is null, then there is no limit.
one-thread-per-connection-taskmaster
)) ¶The maximum number of request threads this taskmaster will simultaneously run before refusing or queueing new connections requests. If the value is null, then there is no limit.
taskmaster
)) ¶Default method – no limit on the number of threads.
one-thread-per-connection-taskmaster
)) ¶The maximum number of request threads this taskmaster will simultaneously run before refusing or queueing new connections requests. If the value is null, then there is no limit.
Returns the current number of taskmaster requests.
one-thread-per-connection-taskmaster
)) ¶The number of taskmaster processing threads currently running.
taskmaster
)) ¶Default method – claim there is one connection thread.
one-thread-per-connection-taskmaster
)) ¶The number of taskmaster processing threads currently running.
Signal a "too many requests" error, just prior to closing the connection.
one-thread-per-connection-taskmaster
) socket) ¶session
) &rest init-args) ¶Set SESSION-STRING slot after the session has been initialized.
one-thread-per-connection-taskmaster
) &rest init-args) ¶Ensure the if MAX-ACCEPT-COUNT is supplied, that it is greater than MAX-THREAD-COUNT.
request
) &rest init-args) ¶The only initarg for a REQUEST object is :HEADERS-IN. All other slot values are computed in this :AFTER method.
ssl-acceptor
) &rest initargs) ¶cookie
) &rest init-args) ¶Ensure COOKIE has a correct slot-value for NAME.
Superclass for all conditions related to Hunchentoot.
condition
.
Superclass for all errors related to Hunchentoot.
error
.
hunchentoot-condition
.
Superclass for all warnings related to Hunchentoot.
hunchentoot-condition
.
warning
.
Signalled if a function was called with incosistent or illegal parameters.
To create a Hunchentoot webserver, you make an
instance of this class and use the generic function START to start it
(and STOP to stop it). Use the :PORT initarg if you don’t want to
listen on the default http port 80. There are other initargs most of
which you probably won’t need very often. They are explained in
detail in the docstrings of the slot definitions for this class.
Unless you are in a Lisp without MP capabilities, you can have several active instances of ACCEPTOR (listening on different ports) at the same time.
accept-connections
.
(setf acceptor-access-log-destination)
.
acceptor-access-log-destination
.
acceptor-address
.
acceptor-dispatch-request
.
(setf acceptor-document-root)
.
acceptor-document-root
.
(setf acceptor-error-template-directory)
.
acceptor-error-template-directory
.
(setf acceptor-input-chunking-p)
.
acceptor-input-chunking-p
.
acceptor-listen-backlog
.
(setf acceptor-listen-socket)
.
acceptor-listen-socket
.
acceptor-log-access
.
acceptor-log-message
.
(setf acceptor-message-log-destination)
.
acceptor-message-log-destination
.
(setf acceptor-name)
.
acceptor-name
.
(setf acceptor-output-chunking-p)
.
acceptor-output-chunking-p
.
(setf acceptor-persistent-connections-p)
.
acceptor-persistent-connections-p
.
acceptor-port
.
acceptor-read-timeout
.
acceptor-remove-session
.
(setf acceptor-reply-class)
.
acceptor-reply-class
.
(setf acceptor-request-class)
.
acceptor-request-class
.
(setf acceptor-requests-in-progress)
.
acceptor-requests-in-progress
.
acceptor-server-name
.
(setf acceptor-shutdown-lock)
.
acceptor-shutdown-lock
.
(setf acceptor-shutdown-p)
.
acceptor-shutdown-p
.
(setf acceptor-shutdown-queue)
.
acceptor-shutdown-queue
.
acceptor-status-message
.
acceptor-status-message
.
acceptor-taskmaster
.
acceptor-write-timeout
.
detach-socket
.
handle-request
.
initialize-connection-stream
.
initialize-instance
.
print-object
.
process-connection
.
process-connection
.
reset-connection-stream
.
start
.
start-listening
.
start-listening
.
stop
.
Initarg | Value |
---|---|
:address | nil |
:port | 80 |
:name | (gensym) |
:request-class | (quote request) |
:reply-class | (quote reply) |
:listen-backlog | 50 |
:taskmaster | (make-instance (cond (*supports-threads-p* (quote one-thread-per-connection-taskmaster)) (t (quote single-threaded-taskmaster)))) |
:output-chunking-p | t |
:input-chunking-p | t |
:persistent-connections-p | t |
:read-timeout | *default-connection-timeout* |
:write-timeout | *default-connection-timeout* |
:access-log-destination | *error-output* |
:message-log-destination | *error-output* |
:document-root | (load-time-value (default-document-directory)) |
:error-template-directory | (load-time-value (default-document-directory errors)) |
The port the acceptor is listening on. The
default is 80. Note that depending on your operating system you might
need special privileges to listen on port 80. When 0, the port will be
chosen by the system the first time the acceptor is started.
:port
This slot is read-only.
The address the acceptor is listening on.
If address is a string denoting an IP address, then the server only
receives connections for that address. This must be one of the
addresses associated with the machine and allowed values are host
names such as "www.zappa.com" and address strings such as
"72.3.247.29". If address is NIL, then the server will receive
connections to all IP addresses on the machine. This is the default.
:address
This slot is read-only.
The optional name of the acceptor, a symbol.
This name can be utilized when defining "easy handlers" - see
DEFINE-EASY-HANDLER. The default name is an uninterned symbol as
returned by GENSYM.
:name
Determines which class of request
objects is created when a request comes in and should be (a symbol
naming) a class which inherits from REQUEST. The default is the
symbol REQUEST.
:request-class
Determines which class of reply
objects is created when a request is served in and should be (a
symbol naming) a class which inherits from REPLY. The default is the
symbol REPLY.
:reply-class
The taskmaster (i.e. an instance of a
subclass of TASKMASTER) that is responsible for scheduling the work
for this acceptor. The default depends on the MP capabilities of the
underlying Lisp.
:taskmaster
This slot is read-only.
A generalized boolean denoting
whether the acceptor may use chunked encoding for output, i.e. when
sending data to the client. The default is T and there’s usually no
reason to change this to NIL.
:output-chunking-p
A generalized boolean denoting
whether the acceptor may use chunked encoding for input, i.e. when
accepting request bodies from the client. The default is T and
there’s usually no reason to change this to NIL.
:input-chunking-p
A generalized boolean
denoting whether the acceptor supports persistent connections, which
is the default for threaded acceptors. If this property is NIL,
Hunchentoot closes each incoming connection after having processed one
request. This is the default for non-threaded acceptors.
:persistent-connections-p
The read timeout of the acceptor,
specified in (fractional) seconds. The precise semantics of this
parameter is determined by the underlying Lisp’s implementation of
socket timeouts. NIL means no timeout.
:read-timeout
This slot is read-only.
The write timeout of the acceptor,
specified in (fractional) seconds. The precise semantics of this
parameter is determined by the underlying Lisp’s implementation of
socket timeouts. NIL means no timeout.
:write-timeout
This slot is read-only.
The socket listening for incoming connections.
Number of pending connections
allowed in the listen socket before the kernel rejects
further incoming connections.
:listen-backlog
This slot is read-only.
A flag that makes the acceptor
shutdown itself when set to something other than NIL.
t
The number of
requests currently in progress.
0
A condition variable
used with soft shutdown, signaled when all requests
have been processed.
(hunchentoot::make-condition-variable)
The lock protecting the shutdown-queue
condition variable and the requests-in-progress counter.
(hunchentoot::make-lock "hunchentoot-acceptor-shutdown")
Destination of the access log
which contains one log entry per request handled in a format similar
to Apache’s access.log. Can be set to a pathname or string
designating the log file, to a open output stream or to NIL to
suppress logging.
:access-log-destination
Destination of the server
error log which is used to log informational, warning and error
messages in a free-text format intended for human inspection. Can be
set to a pathname or string designating the log file, to a open output
stream or to NIL to suppress logging.
:message-log-destination
Directory pathname that
contains error message template files for server-generated error
messages. Files must be named <return-code>.html with <return-code>
representing the HTTP return code that the file applies to,
i.e. 404.html would be used as the content for a HTTP 404 Not found
response. Set *SHOW-LISP-ERRORS-P* to T for this setting to work.
:error-template-directory
Directory pathname that points to
files that are served by the acceptor if no more specific
acceptor-dispatch-request method handles the request.
:document-root
This is the acceptor of the “easy” Hunchentoot framework.
This is an acceptor that mixes the “easy” Hunchentoot with SSL connections.
An abstract class for taskmasters that use multiple threads.
For a concrete class to instantiate, use one-thread-per-connection-taskmaster.
A process that accepts incoming connections and hands them off to new processes for request handling.
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.
It is important to note that MAX-ACCEPT-COUNT and the HTTP 503 behavior
described above is racing with the acceptor listen backlog. If we are receiving
requests faster than threads can be spawned and 503 sent, the requests will be
silently rejected by the kernel.
In a load-balanced environment with multiple Hunchentoot 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 Hunchentoot 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.
create-request-handler-thread
.
decrement-taskmaster-accept-count
.
decrement-taskmaster-thread-count
.
handle-incoming-connection
.
handle-incoming-connection%
.
increment-taskmaster-accept-count
.
increment-taskmaster-thread-count
.
initialize-instance
.
note-free-connection
.
shutdown
.
(setf taskmaster-accept-count)
.
taskmaster-accept-count
.
taskmaster-accept-count-lock
.
(setf taskmaster-max-accept-count)
.
taskmaster-max-accept-count
.
(setf taskmaster-max-thread-count)
.
taskmaster-max-thread-count
.
(setf taskmaster-thread-count)
.
taskmaster-thread-count
.
taskmaster-thread-count-lock
.
taskmaster-wait-lock
.
taskmaster-wait-queue
.
(setf taskmaster-worker-thread-name-format)
.
taskmaster-worker-thread-name-format
.
too-many-taskmaster-requests
.
wait-for-free-connection
.
Initarg | Value |
---|---|
:max-thread-count | *default-max-thread-count* |
:max-accept-count | *default-max-accept-count* |
The maximum number of request threads this taskmaster will simultaneously run before refusing or queueing new connections requests. If the value is null, then there is no limit.
(or integer null)
:max-thread-count
The number of taskmaster processing threads currently running.
integer
0
In the absence of ’atomic-incf’, we need this to atomically increment and decrement the request count.
(hunchentoot::make-lock "taskmaster-thread-count")
This slot is read-only.
The maximum number of connections this taskmaster will accept before refusing new connections. If supplied, this must be greater than MAX-THREAD-COUNT. The number of queued requests is the difference between MAX-ACCEPT-COUNT and MAX-THREAD-COUNT.
(or integer null)
:max-accept-count
The number of connection currently accepted by the taskmaster. These connections are not ensured to be processed, thay may be waiting for an empty processing slot or rejected because the load is too heavy.
integer
0
In the absence of ’atomic-incf’, we need this to atomically increment and decrement the accept count.
(hunchentoot::make-lock "taskmaster-accept-count")
This slot is read-only.
A queue that we use to wait for a free connection.
(hunchentoot::make-condition-variable)
This slot is read-only.
The lock for the connection wait queue.
(hunchentoot::make-lock "taskmaster-thread-lock")
This slot is read-only.
(or string null)
"hunchentoot-worker-~a"
:worker-thread-name-format
Objects of this class hold all the information
about an outgoing reply. They are created automatically by
Hunchentoot and can be accessed and modified by the corresponding
handler.
You should not mess with the slots of these objects directly, but you can subclass REPLY in order to implement your own behaviour. See the REPLY-CLASS slot of the ACCEPTOR class.
The outgoing ’Content-Type’ http
header which defaults to the value of *DEFAULT-CONTENT-TYPE*.
This slot is read-only.
The outgoing ’Content-Length’
http header which defaults NIL. If this is NIL, Hunchentoot will
compute the content length.
This slot is read-only.
An alist of the outgoing http headers
not including the ’Set-Cookie’, ’Content-Length’, and ’Content-Type’
headers. Use the functions HEADER-OUT and (SETF HEADER-OUT) to
modify this slot.
This slot is read-only.
The http return code of this
reply. The return codes Hunchentoot can handle are defined in
specials.lisp.
hunchentoot:+http-ok+
The external format of the reply - used for character output.
hunchentoot:*hunchentoot-default-external-format*
The outgoing cookies. This slot’s
value should only be modified by the functions defined in
cookies.lisp.
Objects of this class hold all the information
about an incoming request. They are created automatically by
acceptors and can be accessed by the corresponding handler.
You should not mess with the slots of these objects directly, but you can subclass REQUEST in order to implement your own behaviour. See the REQUEST-CLASS slot of the ACCEPTOR class.
(setf aux-data)
.
aux-data
.
content-stream
.
cookies-in
.
get-parameters
.
handle-request
.
headers-in
.
initialize-instance
.
local-addr
.
local-port
.
post-parameters
.
post-parameters
.
query-string
.
remote-addr
.
remote-port
.
request-acceptor
.
request-method
.
request-uri
.
script-name
.
server-protocol
.
(setf session)
.
session
.
session-verify
.
The acceptor which created this request object.
:acceptor
This slot is read-only.
An alist of the incoming headers.
:headers-in
This slot is read-only.
The request method as a keyword.
common-lisp
.
:method
This slot is read-only.
The request URI as a string.
:uri
This slot is read-only.
The HTTP protocol as a keyword.
:server-protocol
This slot is read-only.
The IP address of the local system that the client connected to.
:local-addr
This slot is read-only.
The TCP port number of the local system that the client connected to.
:local-port
This slot is read-only.
The IP address of the client that initiated this request.
:remote-addr
This slot is read-only.
The TCP port number of the client socket from which this request originated.
:remote-port
This slot is read-only.
A stream from which the request body can be read if there is one.
:content-stream
This slot is read-only.
An alist of the cookies sent by the client.
This slot is read-only.
An alist of the GET parameters sent by the client.
This slot is read-only.
An alist of the POST parameters sent by the client.
This slot is read-only.
The URI requested by the client without the query string.
This slot is read-only.
The query string of this request.
This slot is read-only.
The session object associated with this request.
Used to keep a user-modifiable alist with arbitrary data during the request.
The raw string sent as the body of a
POST request, populated only if not a multipart/form-data request.
SESSION objects are automatically maintained by
Hunchentoot. They should not be created explicitly with MAKE-INSTANCE
but implicitly with START-SESSION and they should be treated as opaque
objects.
You can ignore Hunchentoot’s SESSION objects altogether and implement your own sessions if you provide corresponding methods for SESSION-COOKIE-VALUE and SESSION-VERIFY.
The unique ID (an INTEGER) of the session.
integer
(hunchentoot:next-session-id (hunchentoot:request-acceptor hunchentoot:*request*))
This slot is read-only.
The session string encodes enough
data to safely retrieve this session. It is sent to the browser as a
cookie value or as a GET parameter.
This slot is read-only.
The incoming ’User-Agent’ header that was sent when this session was created.
(hunchentoot:user-agent hunchentoot:*request*)
This slot is read-only.
The remote IP address of the client
when this session was started as returned by REAL-REMOTE-ADDR.
(hunchentoot:real-remote-addr hunchentoot:*request*)
This slot is read-only.
The time this session was started.
(get-universal-time)
This slot is read-only.
The last time this session was used.
(get-universal-time)
This slot is read-only.
Data associated with this session - see SESSION-VALUE.
:session-data
This slot is read-only.
The time (in seconds) after which this session expires if it’s not used.
fixnum
hunchentoot:*session-max-time*
:max-time
A taskmaster that runs synchronously in the thread
where the START function was invoked (or in the case of LispWorks in
the thread started by COMM:START-UP-SERVER). This is the simplest
possible taskmaster implementation in that its methods do nothing but
calling their acceptor "sister" methods - EXECUTE-ACCEPTOR calls
ACCEPT-CONNECTIONS, HANDLE-INCOMING-CONNECTION calls
PROCESS-CONNECTION.
Create and START an instance of this class
(instead of ACCEPTOR) if you want an https server. There are two
required initargs, :SSL-CERTIFICATE-FILE and :SSL-PRIVATEKEY-FILE, for
pathname designators denoting the certificate file and the key file in
PEM format. On LispWorks, you can have both in one file in which case
the second initarg is optional. You can also use the
:SSL-PRIVATEKEY-PASSWORD initarg to provide a password (as a string)
for the key file (or NIL, the default, for no password).
The default port for SSL-ACCEPTOR instances is 443 instead of 80
Initarg | Value |
---|---|
:port | 443 |
A pathname designator for a certificate file in PEM format.
:ssl-certificate-file
This slot is read-only.
A pathname designator for a
private key file in PEM format, or (only on LispWorks) NIL if the
certificate file contains the private key.
:ssl-privatekey-file
This slot is read-only.
The password for the
private key file or NIL for no password.
:ssl-privatekey-password
This slot is read-only.
An instance of this class is responsible for
distributing the work of handling requests for its acceptor. This is
an "abstract" class in the sense that usually only instances of
subclasses of TASKMASTER will be used.
A backpointer to the acceptor instance this taskmaster works for.
Length of buffers used for internal purposes.
A 2-element array consisting of the character codes for a CRLF sequence.
The three-character names of the seven days of the week - needed for cookie date format.
HTTP return code (510) for ’Not Extended’.
A link to the website of the underlying Lisp implementation.
A FLEXI-STREAMS external format used for ‘faithful’ input and output of binary data.
The three-character names of the twelve months - needed for cookie date format.
A FLEXI-STREAMS external format used internally for logging and to encode cookie values.
A global lock to prevent concurrent access to the log file used by the ACCEPTOR-LOG-ACCESS function.
This variable is set to NIL during the processing of a handler to tell the acceptor not to close the connection after it is done.
An alist of (URI acceptor-names function host) lists defined by DEFINE-EASY-HANDLER.
Hash tables used internally by READ-UNTIL to cache offset arrays.
Will be set to T if PROCESS-CONNECTION is to stop processing more requests on the current socket connection.
A global lock to prevent two threads from modifying *session-db* at the same time (or NIL for Lisps which don’t have threads).
Used internally to check whether the reply headers have already been sent for this request.
Used to map numerical return codes to reason phrases.
The stream representing the socket Hunchentoot is listening on.
A global lock to prevent concurrent access to the log file used by the ACCEPTOR-LOG-MESSAGE function.
A hash table which maps file suffixes to MIME types.
An alist where the cars are MIME types and the cdrs are list of file suffixes for the corresponding type.
The default (global) session database.
A fresh random state.
A list of temporary files created while a request was handled.
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.
Make sure VALUE is evaluated only once (to appease SBCL).
Convenience macro to declare unbound special variables with a documentation string.
Like HANDLER-CASE, but observes *CATCH-ERRORS-P*.
Like IGNORE-ERRORS, but observes *CATCH-ERRORS-P*.
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 SETQ to store the new vector in VECTOR.
Execute BODY with ACCEPTOR-REQUESTS-IN-PROGRESS of ACCEPTOR incremented by one. If the ACCEPTOR-SHUTDOWN-P returns true after the BODY has been executed, the ACCEPTOR-SHUTDOWN-QUEUE condition variable of the ACCEPTOR is signalled in order to finish shutdown processing.
Run BODY with conditions caught and logged by the *ACCEPTOR*. Errors are stopped right away so no other part of the software is impacted by them.
Executes BODY and invokes the debugger if an error is signaled and *CATCH-ERRORS-P* is NIL.
Simple wrapper to allow LispWorks and Bordeaux Threads to coexist.
Helper macro to write log entries. STREAM-VAR is a symbol that
will be bound to the logging stream during the execution of BODY.
DESTINATION is the logging destination, which can be either a pathname
designator of the log file, a symbol designating an open stream or NIL
if no logging should be done. LOCK refers to the lock that should be
held during the logging operation. If DESTINATION is a pathname, a
flexi stream with UTF-8 encoding will be created and bound to
STREAM-VAR. If an error occurs while writing to the log file, that
error will be logged to *ERROR-OUTPUT*.
Note that logging to a file involves opening and closing the log file for every logging operation, which is overall costly. Web servers with high throughput demands should make use of a specialized logging function rather than relying on Hunchentoot’s default logging facility.
Run BODY with usocket condition mapping in effect, i.e. platform specific network errors will be signalled as usocket conditions. For Lispworks, no mapping is performed.
This is like WITH-LOCK-HELD except that it will accept NIL as a "lock" and just execute BODY in this case.
Make a REQUEST instance for the ACCEPTOR, setting up those slots that are determined from the SOCKET by calling the appropriate socket query functions.
Removes all GET parameters named COOKIE-NAME from URL and then adds a new GET parameter with the name COOKIE-NAME and the value VALUE. If REPLACE-AMPERSANDS-P is true all literal ampersands in URL are replaced with ’&’. The resulting URL is returned.
Returns a string with information about Hunchentoot suitable for inclusion in HTML output.
Checks whether *STANDARD-OUTPUT* currently ’looks at’ the string "–". Will move the position within the stream by one unless the first characters it sees is not a hyphen.
Retrieves all parameters from PARAMETERS which are named like "PARAMETER-NAME[N]" (where N is a non-negative integer), converts them to TYPE, and returns an array where the Nth element is the corresponding value.
Retrieves all parameters from PARAMETERS which are named like "PARAMETER-NAME{FOO}" (where FOO is any sequence of characters not containing curly brackets), converts them to TYPE, and returns a hash table with test function TEST-FUNCTION where the corresponding value is associated with the key FOO (converted to KEY-TYPE).
Retrieves all parameters from PARAMETERS which are named PARAMETER-NAME, converts them to TYPE, and returns a list of them.
Computes and returns the parameter(s) called PARAMETER-NAME and converts it/them according to the value of PARAMETER-TYPE. REQUEST-TYPE is one of :GET, :POST, or :BOTH.
Computes the ‘real’ paramater name (a string) from the Lisp symbol SYMBOL. Used in cases where no parameter name is provided.
Retrieves the parameter named PARAMETER-NAME using the reader PARAMETER-READER and converts it to TYPE.
The rfc2388 package 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.
Converts the string ARGUMENT to TYPE where TYPE is one of the symbols STRING, CHARACTERS, INTEGER, KEYWORD, or BOOLEAN - or otherwise a function designator for a function of one argument. ARGUMENT can also be NIL in which case this function also returns NIL unconditionally.
Converts UNIVERSAL-TIME to cookie date format.
Converts a list of cookies of the form "key=value" to an alist. No character set processing is done.
Returns a random number (as a string) with base BASE and N digits.
Creates a uniquely encoded session string based on the values ID, USER-AGENT, REMOTE-ADDR, and START
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.
Converts a list FORM-URL-ENCODED-LIST of name/value pairs into an alist. Both names and values are url-decoded while doing this.
Returns a string with a backtrace of what the Lisp system thinks is the "current" error.
Returns the local address and port of the socket SOCKET as two values. The address is returned as a string in dotted IP address notation, resp. IPv6 notation.
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, resp. IPv6 notation.
Reads the request body from the stream and stores the raw contents (as an array of octets) in the corresponding slot of the REQUEST object. Returns just the stream if WANT-STREAM is true. If there’s a Content-Length header, it is assumed, that ALREADY-READ octets have already been read.
Reads incoming headers from the client via STREAM. Returns as multiple values the headers as an alist, the method, the URI, and the protocol of the request.
Returns the SESSION object corresponding to the number ID if the session has not expired. Will remove the session if it has expired but will not create a new one.
Returns a true value if the outgoing http header named NAME has been specified already. NAME should be a keyword or a string.
Signals a warning of type HUNCHENTOOT-SIMPLE-WARNING with the provided format control and arguments.
Whether input chunking is currently switched on for *HUNCHENTOOT-STREAM* - note that this will return NIL if the stream not a chunked stream.
Returns the universal time TIME as a string in full ISO format.
Returns a true value unless the incoming request’s headers or the server’s PERSISTENT-CONNECTIONS-P setting obviate a keep-alive reply. The second return value denotes whether the client has explicitly asked for a persistent connection.
Checks whether C is a character between A and Z (case-insensitive).
Creates a keyword parameter to be used by DEFINE-EASY-HANDLER. DESCRIPTION is one of the elements of DEFINE-EASY-HANDLER’s LAMBDA-LIST and DEFAULT-PARAMETER-TYPE and DEFAULT-REQUEST-TYPE are the global default values.
Simple wrapper to allow LispWorks and Bordeaux Threads to coexist.
Returns a stream for the socket SOCKET. The ACCEPTOR argument is ignored.
Generates a unique name for a temporary file. This function is called from the RFC2388 library when a file is uploaded.
Given the contents of a CONTENT-TYPE header, add a charset= attribute describing the given EXTERNAL-FORMAT if no charset= attribute is already present and the content type is a text content type. Returns the augmented content type.
Helper function for handle-static-file. Determines whether the requests specifies a Range header. If so, parses the header and position the already opened file to the location specified. Returns the number of bytes to transfer from the file. Invalid specified ranges are reported to the client with a HTTP 416 status code.
Make sure that any POST parameters in the REQUEST are parsed. The body of the request must be either application/x-www-form-urlencoded or multipart/form-data to be considered as containing POST parameters. If FORCE is true, parsing is done unconditionally. Otherwise, parsing will only be done if the RAW-POST-DATA slot in the REQUEST is false. EXTERNAL-FORMAT specifies the external format of the data in the request body. By default, the encoding is determined from the Content-Type header of the request or from *HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT* if none is found.
Rewrites the HTML page HTML such that the name/value pair COOKIE-NAME/COOKIE-VALUE is inserted if the client hasn’t sent a cookie of the same name but only if *REWRITE-FOR-SESSION-URLS* is true. See the docs for URL-REWRITE:REWRITE-URLS.
Calculates the md5 sum of the string STRING and returns it as a hex string.
Checks whether C is a name constituent character in the sense of HTML.
Used to signal an error if an operation named NAME is not implemented.
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.
Return a relative pathname that has been verified to not contain any directory traversals or explicit device or host fields. Returns NIL if the path is not acceptable.
Creates an alist of POST parameters from the stream STREAM which is supposed to be of content type ’multipart/form-data’.
PEEK-CHAR with input stream bound to *STANDARD-INPUT* and returning NIL on EOF.
Quotes string according to RFC 2616’s definition of ‘quoted-string’.
Read characters from *STANDARD-INPUT* assuming that they constitue a SGML-style attribute/value pair. Returns three values - the name of the attribute, its value, and the whole string which was read. On EOF the string(s) read so far is/are returned. If SKIP is true NIL is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.
Reads and returns as its first value a string from *STANDARD-INPUT*. The string is either delimited by ’ or " in which case the delimiters aren’t part of the string but the second return value is the delimiter character or it is assumed to extend to the next character which is not a name constituent (see NAME-CHAR-P). On EOF the string read so far is returned. If SKIP is true NIL is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.
Reads and returns the initial HTTP request line, catching permitted errors and handling *BREAK-EVEN-WHILE-READING-REQUEST-TYPE-P*. If no request could be read, returns NIL. At this point, both an end-of-file as well as a timeout condition are normal; end-of-file will occur when the client has decided to not send another request but to close the connection instead, a timeout indicates that the connection timeout established by Hunchentoot has expired and we do not want to wait for another request any longer.
Read characters from *STANDARD-INPUT* as long as they are name constituents. Returns the string which was read unless SKIP is true. On EOF the string read so far is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.
Reads characters from *STANDARD-INPUT* up to and including STRING. Returns the string which was read (excluding STRING) unless SKIP is true. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true. On EOF the string read so far is returned.
Reads characters from *STANDARD-INPUT* while PREDICATE returns a true value for each character. Returns the string which was read unless SKIP is true. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true. On EOF the string read so far is returned.
Returns a CL-PPCRE scanner which matches a GET parameter in a URL. Scanners are memoized in SCANNER-HASH once they are created.
Send a “Bad Request” response to the client.
Send a HTTP response to the STREAM and log the event in ACCEPTOR.
STATUS-CODE is the HTTP status code used in the response. HEADERS
and COOKIES are used to create the response header. If CONTENT is
provided, it is sent as the response body.
If *HEADER-STREAM* is not NIL, the response headers are written to
that stream when they are written to the client.
STREAM is returned.
A helper function to send out a quick error reply, before any state is set up via PROCESS-REQUEST.
Send a “HTTP Version Not Supported” response to the client.
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.
Skip SGML comment from *STANDARD-INPUT*, i.e. a string enclosed in ’–’ on both sides. Returns no values. Writes all characters read to *STANDARD-OUTPUT*. This function assumes (without checking) that the current position of *STANDARD-INPUT* is at the beginning of a comment, after the first hyphen - see COMMENT-START-P.
Read characters from *STANDARD-INPUT* as long as they are whitespace. Returns the string which was read unless SKIP is true. On EOF the string read so far is returned. Writes all characters read to *STANDARD-OUTPUT* if WRITE-THROUGH is true.
Sends all headers and maybe the content body to
*HUNCHENTOOT-STREAM*. Returns immediately and does nothing if called
more than once per request. Called by PROCESS-REQUEST and/or
SEND-HEADERS. The RETURN-CODE argument represents the integer return
code of the request. The corresponding reason phrase is determined by
calling the REASON-PHRASE function. The CONTENT provided represents
the body data to send to the client, if any. If it is not specified,
no body is written to the client. The handler function is expected to
directly write to the stream in this case.
Returns the stream that is connected to the client.
Tests whether the sequence SEQ starts with one of the sequences in SUBSEQ-LIST. Individual elements are compared with TEST.
Tests whether the sequence SEQ starts with the sequence SUBSEQ. Individual elements are compared with TEST.
Intern STRING as keyword using the reader so that case conversion is done with the reader defaults.
Creates a string representing the SESSION object SESSION. See ENCODE-SESSION-STRING.
Creates a dummy connection to the acceptor, waking ACCEPT-CONNECTIONS while it is waiting. This is supposed to force a check of ACCEPTOR-SHUTDOWN-P.
Checks whether C is a whitespace character.
multi-threaded-taskmaster
)) ¶multi-threaded-taskmaster
)) ¶A process that accepts incoming connections and hands them off to new processes for request handling.
Returns a string which can be used for ’Server’ headers.
Similar to CL:ASSOC, but ’does the right thing’ if THING is a string or a symbol.
cookie
)) ¶cookie
)) ¶The SameSite attribute for the cookie, needs
to be one of "None", "Lax" or "Strict". Defaults to "None". See
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7>.
one-thread-per-connection-taskmaster
)) ¶one-thread-per-connection-taskmaster
) socket) ¶operation-not-implemented
)) ¶one-thread-per-connection-taskmaster
)) ¶one-thread-per-connection-taskmaster
)) ¶Note that a connection has been freed up
one-thread-per-connection-taskmaster
)) ¶one-thread-per-connection-taskmaster
)) ¶The number of connection currently accepted by the taskmaster. These connections are not ensured to be processed, thay may be waiting for an empty processing slot or rejected because the load is too heavy.
one-thread-per-connection-taskmaster
)) ¶In the absence of ’atomic-incf’, we need this to atomically increment and decrement the accept count.
one-thread-per-connection-taskmaster
)) ¶In the absence of ’atomic-incf’, we need this to atomically increment and decrement the request count.
one-thread-per-connection-taskmaster
)) ¶The lock for the connection wait queue.
one-thread-per-connection-taskmaster
)) ¶A queue that we use to wait for a free connection.
one-thread-per-connection-taskmaster
)) ¶automatically generated reader method
one-thread-per-connection-taskmaster
)) ¶automatically generated writer method
one-thread-per-connection-taskmaster
)) ¶Wait for a connection to be freed up
Accepts a string KEY and a Lisp object VALUE and writes them directly to the client as an HTTP header line.
Like HUNCHENTOOT-ERROR but with formatting capabilities.
hunchentoot-error
.
simple-condition
.
Like HUNCHENTOOT-WARNING but with formatting capabilities.
hunchentoot-warning
.
simple-condition
.
This warning is signalled when an operation (like SETUID for example) is not implemented for a specific Lisp.
The name of the unimplemented operation.
:operation
This slot is read-only.
Each COOKIE objects describes one outgoing cookie.
(setf cookie-domain)
.
cookie-domain
.
(setf cookie-expires)
.
cookie-expires
.
(setf cookie-http-only)
.
cookie-http-only
.
(setf cookie-max-age)
.
cookie-max-age
.
cookie-name
.
(setf cookie-path)
.
cookie-path
.
(setf cookie-same-site)
.
cookie-same-site
.
(setf cookie-secure)
.
cookie-secure
.
(setf cookie-value)
.
cookie-value
.
initialize-instance
.
stringify-cookie
.
The name of the cookie - a string.
string
:name
This slot is read-only.
The value of the cookie. Will be URL-encoded when sent to the browser.
""
:value
The time (a universal time) when the cookie expires (or NIL).
:expires
The time delta (in seconds) after which the cookie expires (or NIL).
:max-age
The path this cookie is valid for (or NIL).
:path
The domain this cookie is valid for (or NIL).
:domain
The SameSite attribute for the cookie, needs
to be one of "None", "Lax" or "Strict". Defaults to "None". See
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7>.
:same-site
A generalized boolean denoting whether this cookie is a secure cookie.
:secure
A generalized boolean denoting whether
this cookie is a ‘HttpOnly’ cookie.
This is a Microsoft extension that has been implemented in Firefox as well. See <http://msdn2.microsoft.com/en-us/library/ms533046.aspx>.
:http-only
Jump to: | (
A C D E F G H I K L M N P Q R S T U W |
---|
Jump to: | (
A C D E F G H I K L M N P Q R S T U W |
---|
Jump to: | *
+
A C D E G H I L M N O P Q R S T U V W |
---|
Jump to: | *
+
A C D E G H I L M N O P Q R S T U V W |
---|
Jump to: | A B C E F H L M O P R S T U |
---|
Jump to: | A B C E F H L M O P R S T U |
---|