release 1.2.28
[hunchentoot.git] / www / hunchentoot-doc.html
blob2a76d71631ac69ad0f149ae132a10170378e081c
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
2 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta><title>Hunchentoot - The Common Lisp web server formerly known as TBNL</title><meta name="description" content="
3 A full-featured web server written in Common Lisp offering things
4 like HTTP/1.1 chunking, persistent connections, and SSL. Includes
5 a framework for building dynamic websites interactively.
6 "></meta><style type="text/css">
7 body { background-color: #ffffff }
8 pre { padding:5px; background-color:#e0e0e0 }
9 pre.none { padding:5px; background-color:#ffffff }
10 h3, h4, h5 { text-decoration: underline; }
11 .entry-type { padding-left: 1em; font-size: 60%; font-style: italic }
12 a { text-decoration: none; padding: 1px 2px 1px 2px; }
13 a:visited { text-decoration: none; padding: 1px 2px 1px 2px; }
14 a:hover { text-decoration: none; padding: 1px 1px 1px 1px; border: 1px solid #000000; }
15 a:focus { text-decoration: none; padding: 1px 2px 1px 2px; border: none; }
16 a.none { text-decoration: none; padding: 0; }
17 a.none:visited { text-decoration: none; padding: 0; }
18 a.none:hover { text-decoration: none; border: none; padding: 0; }
19 a.none:focus { text-decoration: none; border: none; padding: 0; }
20 a.noborder { text-decoration: none; padding: 0; }
21 a.noborder:visited { text-decoration: none; padding: 0; }
22 a.noborder:hover { text-decoration: none; border: none; padding: 0; }
23 a.noborder:focus { text-decoration: none; border: none; padding: 0; }
24 </style></head><body>
28 <h2>
29 <a href="http://www.htg1.de/hunchentoot/hunchentoot.html" title="Click here for the Hunchentoot logo" class="noborder">
30 <img align="top" width="93" height="45" border="0" src="hunchentoot.gif"></img>
31 </a>
32 Hunchentoot - The Common Lisp web server formerly known as TBNL
33 </h2>
35 <blockquote>
36 <h3 xmlns=""><a class="none" name="abstract">Abstract</a></h3>
37 <p>
38 Hunchentoot is a web server written in Common Lisp and at the
39 same time a toolkit for building dynamic websites. As a
40 stand-alone web server, Hunchentoot is capable of HTTP/1.1
41 chunking (both directions), persistent connections
42 (keep-alive), and SSL.
43 </p>
44 <p>
45 Hunchentoot provides facilities like automatic session
46 handling (with and without cookies), logging, customizable
47 error handling, and easy access to GET and POST parameters
48 sent by the client. It does <em>not</em> include functionality
49 to programmatically generate HTML output. For this task you
50 can use any library you like, e.g. (shameless self-plug)
51 <a href="http://weitz.de/cl-who/">CL-WHO</a> or
52 <a href="http://weitz.de/html-template/">HTML-TEMPLATE</a>.
53 </p>
54 <p>
55 Hunchentoot talks with its front-end or with the client over
56 TCP/IP sockets and optionally uses multiprocessing to handle
57 several requests at the same time. Therefore, it cannot be
58 implemented completely in
59 <a href="http://www.lispworks.com/documentation/HyperSpec/Front/index.htm">portable
60 Common Lisp</a>. It currently works "natively" with
61 <a href="http://www.lispworks.com/">LispWorks</a> (which is the
62 main development and testing platform), and additionally on all
63 Lisps which are supported by the compatibility
64 layers <a href="http://common-lisp.net/project/usocket/">usocket</a>
65 and <a href="http://common-lisp.net/project/bordeaux-threads/">Bordeaux
66 Threads</a>.
67 </p>
68 <p>
69 Hunchentoot comes with a
70 <a href="http://www.opensource.org/licenses/bsd-license.php">BSD-style
71 license</a> so you can basically do with it whatever you want.
72 </p>
73 <p>
74 Hunchentoot is (or was) for example used by
75 <a href="http://quickhoney.com/">QuickHoney</a>,
76 <a href="http://www.city-farming.de/">City Farming</a>,
77 <a href="http://heikestephan.de/">Heike Stephan</a>.
78 </p>
79 <p>
80 <font color="red">Download shortcut:</font>
81 <a href="http://weitz.de/files/hunchentoot.tar.gz">http://weitz.de/files/hunchentoot.tar.gz</a>.
82 </p>
84 </blockquote>
86 <h3 xmlns=""><a class="none" name="contents">Contents</a></h3>
87 <ol xmlns="">
88 <li><a href="#abstract">Abstract</a></li>
89 <li><a href="#contents">Contents</a></li>
90 <li>
91 <a href="#install">Download and installation</a><ol>
92 <li><a href="#port80">Running Hunchentoot on port 80</a></li>
93 <li><a href="#proxy">Hunchentoot behind a proxy</a></li>
94 </ol>
95 </li>
96 <li><a href="#support">Support</a></li>
97 <li><a href="#start">Your own webserver (the easy teen-age New York version)</a></li>
98 <li><a href="#extras">Third party documentation and add-ons</a></li>
99 <li>
100 <a href="#reference">Function and variable reference</a><ol>
101 <li><a href="#acceptors">Acceptors</a></li>
102 <li><a href="#acceptor-behaviour">Customizing acceptor behaviour</a></li>
103 <li><a href="#subclassing-acceptors">An example of how to subclass ACCEPTOR</a></li>
104 <li><a href="#taskmasters">Taskmasters</a></li>
105 <li><a href="#request-dispatch">Request dispatch and handling</a></li>
106 <li><a href="#easy-handlers">Using the easy-handler framework</a></li>
107 <li><a href="#requests">Request objects</a></li>
108 <li><a href="#replies">Reply objects</a></li>
109 <li><a href="#sessions">Sessions</a></li>
110 <li><a href="#session-behaviour">Customizing session behaviour</a></li>
111 <li><a href="#cookies">Cookies</a></li>
112 <li><a href="#logging">Logging</a></li>
113 <li><a href="#conditions">Conditions and error handling</a></li>
114 <li><a href="#misc">Miscellaneous</a></li>
115 </ol>
116 </li>
117 <li><a href="#testing">Testing</a></li>
118 <li><a href="#debugging">Debugging</a></li>
119 <li><a href="#history">History</a></li>
120 <li><a href="#index">Symbol index</a></li>
121 <li><a href="#ack">Acknowledgements</a></li>
122 </ol>
124 <h3 xmlns=""><a class="none" name="install">Download and installation</a></h3>
125 Hunchentoot depends on a couple of other Lisp libraries which you'll need
126 to install first:
127 <ul>
128 <li>Pierre R. Mai's <a href="http://www.cliki.net/md5">MD5</a>,</li>
129 <li>Kevin Rosenberg's <a href="http://www.cliki.net/cl-base64">CL-BASE64</a>,</li>
130 <li>Janis Dzerins' <a href="http://common-lisp.net/project/rfc2388/">RFC2388</a>,</li>
131 <li>Peter Seibel's <a href="http://weitz.de/cl-fad/">CL-FAD</a>,</li>
132 <li>Gary King's <a href="http://common-lisp.net/project/trivial-backtrace/">trivial-backtrace</a>,</li>
133 <li>Erik Huelsmann's <a href="http://common-lisp.net/project/usocket">usocket</a> (unless you're using LispWorks),</li>
134 <li>Greg Pfeil's <a href="http://common-lisp.net/project/bordeaux-threads/">Bordeaux Threads</a> (unless you're using LispWorks),
135 </li>
136 <li>
137 David Lichteblau's <a href="http://common-lisp.net/project/cl-plus-ssl/">CL+SSL</a>
138 (unless you're using LispWorks),
139 </li>
140 <li>
141 and my own <a href="http://weitz.de/flexi-streams/">FLEXI-STREAMS</a> (0.12.0 or higher),
142 <a href="http://weitz.de/chunga/">Chunga</a> (1.0.0 or
143 higher), and <a href="http://weitz.de/cl-ppcre/">
144 CL-PPCRE</a> (plus
145 <a href="http://weitz.de/cl-who/">CL-WHO</a> for the <a href="#start">example code</a>
146 and <a href="http://weitz.de/drakma/">Drakma</a> for the <a href="#testing">tests</a>).
147 </li>
148 </ul>
150 Make sure to use the <em>newest</em> versions of all of these
151 libraries (which might themselves depend on other libraries) - try
152 the repository versions if you're in doubt. Note: You can compile
153 Hunchentoot without SSL support - and thus without the need to
154 have CL+SSL - if you add <code>:HUNCHENTOOT-NO-SSL</code> to
155 <a href="http://www.lispworks.com/documentation/HyperSpec/Body/v_featur.htm">
156 <code>*FEATURES*</code></a> <em>before</em> you compile it.
158 Hunchentoot will only work with Lisps where
159 the <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#character_code">character
160 codes</a> of
161 all <a href="http://en.wikipedia.org/wiki/ISO/IEC_8859-1">Latin-1</a>
162 characters coincide with their
163 Unicode <a href="http://en.wikipedia.org/wiki/Code_point">code
164 points</a> (which is the case for all current implementations I
165 know).
166 </p>
168 Hunchentoot itself together with this documentation can be
169 downloaded from
170 <a href="http://weitz.de/files/hunchentoot.tar.gz">http://weitz.de/files/hunchentoot.tar.gz</a>.
171 The current version is 1.2.28.
172 </p>
174 The preferred method to compile and load Hunchentoot is via <a href="http://www.cliki.net/asdf">ASDF</a>. If you want to avoid
175 downloading and installing all the dependencies manually, give
176 Zach Beane's excellent <a href="http://www.quicklisp.org/">Quicklisp</a> system a try.
177 </p>
179 Hunchentoot and its dependencies can also be installed with <a href="http://common-lisp.net/project/clbuild/">clbuild</a>.
180 There's also a port for <a href="http://www.gentoo.org/proj/en/lisp/common-lisp/index.xml">Gentoo
181 Linux</a> thanks to Matthew Kennedy.
182 </p>
184 The current development version of Hunchentoot can be found
185 at <a href="https://github.com/edicl/hunchentoot">https://github.com/edicl/hunchentoot</a>.
186 If you want to send patches, please fork the github repository and send pull requests.
187 </p>
189 <h4 xmlns=""><a name="port80">Running Hunchentoot on port 80</a></h4>
191 Hunchentoot does not come with code to help with running it on a
192 privileged port (i.e. port 80 or 443) on Unix-like operating
193 systems. Modern Unix-like systems have specific, non-portable
194 ways to allow non-root users to listen to privileged ports, so
195 including such functionality in Hunchentoot was considered
196 unnecessary. Please refer to online resources for help. At the
197 time of this writing, the YAWS documentation has a <a href="http://yaws.hyber.org/privbind.yaws">comprehensive
198 writeup</a> on the topic.
201 <h4 xmlns=""><a name="proxy">Hunchentoot behind a proxy</a></h4>
203 If you're feeling unsecure about exposing Hunchentoot to the wild,
204 wild Internet or if your Lisp web application is part of a larger
205 website, you can hide it behind a
206 <a href="http://en.wikipedia.org/wiki/Proxy_server">proxy server</a>.
207 One approach that I have used several times is to employ Apache's
208 <a href="http://httpd.apache.org/docs/current/mod/mod_proxy.html">mod_proxy</a>
209 module with a configuration that looks like this:
211 <pre><a href="http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass" class="noborder">ProxyPass</a> /hunchentoot http://127.0.0.1:3000/hunchentoot
212 <a href="http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassreverse" class="noborder">ProxyPassReverse</a> /hunchentoot http://127.0.0.1:3000/hunchentoot</pre>
214 This will tunnel all requests where the URI path begins with
215 <code>"/hunchentoot"</code> to a (Hunchentoot) server listening on
216 port 3000 on the same machine.
219 Of course, there are
220 <a href="http://www.red-bean.com/pipermail/lispweb/2006-October/001342.html">several
221 other</a> (more lightweight) web proxies that you could use
222 instead of Apache.
223 </p>
227 <h3 xmlns=""><a class="none" name="support">Support</a></h3>
229 The development version of Hunchentoot can be found <a href="https://github.com/edicl/hunchentoot" target="_new">on
230 github</a>. Please use the github issue tracking system to
231 submit bug reports. Patches are welcome, please use <a href="https://github.com/edicl/hunchentoot/pulls">GitHub pull
232 requests</a>. If you want to make a change, please <a href="http://weitz.de/patches.html" target="_new">read this
233 first</a>.
234 </p>
237 <h3 xmlns=""><a class="none" name="start">Your own webserver (the easy teen-age New York version)</a></h3>
238 Starting your own web server is pretty easy. Do something like this:
239 <pre>(hunchentoot:<a class="noborder" href="#start">start</a> (make-instance 'hunchentoot:<a class="noborder" href="#acceptor">easy-acceptor</a> :port 4242))</pre>
240 That's it. Now you should be able to enter the address
241 "<a href="http://127.0.0.1:4242/"><code>http://127.0.0.1:4242/</code></a>" in
242 your browser and see something, albeit nothing very interesting
243 for now.
246 By default, Hunchentoot serves the files from the
247 <code><i>www/</i></code> directory in its source tree. In the
248 distribution, that directory contains a HTML version of the
249 documentation as well as the error templates. The location of
250 the document root directory can be specified when creating a new
251 <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> instance by the way of the
252 <code xmlns=""><a href="#acceptor-document-root">ACCEPTOR-DOCUMENT-ROOT</a></code>. Likewise, the
253 location of the error template directory can be specified by the
254 <code xmlns=""><a href="#acceptor-error-template-directory">ACCEPTOR-ERROR-TEMPLATE-DIRECTORY</a></code>. Both
255 <code xmlns=""><a href="#acceptor-document-root">ACCEPTOR-DOCUMENT-ROOT</a></code> and
256 <code xmlns=""><a href="#acceptor-error-template-directory">ACCEPTOR-ERROR-TEMPLATE-DIRECTORY</a></code> can be
257 specified using a logical pathname, which will be translated
258 once when the <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> is instantiated.
259 </p>
262 The <code xmlns=""><a href="#easy-acceptor">EASY-ACCEPTOR</a></code> class implements a
263 framework for developing web applications. Handlers are defined
264 using the <code xmlns=""><a href="#define-easy-handler">DEFINE-EASY-HANDLER</a></code> macro.
265 Request dispatching is performed according to the list of
266 dispatch functions in <code xmlns=""><a href="#*dispatch-table*">*DISPATCH-TABLE*</a></code>.
267 Each of the functions on that list is called to determine
268 whether it wants to handle the request, provided as single
269 argument. If a dispatcher function wants to handle the request,
270 it returns another function to actually create the desired page.
271 </p>
274 <code xmlns=""><a href="#define-easy-handler">DEFINE-EASY-HANDLER</a></code> is accompanied by a set
275 of dispatcher creation functions that can be used to create
276 dispatchers for standard tasks. These are documented in the <a class="noborder" href="#easy-handlers">subchapter on easy
277 handlers</a>
278 </p>
281 Now be a bit more adventurous, try this
282 <pre>(hunchentoot:<a class="noborder" href="#define-easy-handler">define-easy-handler</a> (say-yo :uri "/yo") (name)
283 (setf (hunchentoot:<a class="noborder" href="#content-type*">content-type*</a>) "text/plain")
284 (format nil "Hey~@[ ~A~]!" name))</pre>
285 and see what happens at "<a href="http://127.0.0.1:4242/yo"><code>http://127.0.0.1:4242/yo</code></a>" or
286 "<a href="http://127.0.0.1:4242/yo?name=Dude"><code>http://127.0.0.1:4242/yo?name=Dude</code></a>" .
287 </p>
290 Hunchentoot comes with a little example website which you can use
291 to see if it works and which should also demonstrate a couple of
292 the things you can do with Hunchentoot. To start the example
293 website, enter the following code into your listener:
295 <pre>(<a class="noborder" href="http://common-lisp.net/~mmommer/asdf-howto.shtml#sec11">asdf:oos</a> 'asdf:load-op :hunchentoot-test)</pre>
297 Now go to "<a href="http://127.0.0.1:4242/hunchentoot/test"><code>http://127.0.0.1:4242/hunchentoot/test</code></a>" and play a bit.
298 </p>
301 <h3 xmlns=""><a class="none" name="extras">Third party documentation and add-ons</a></h3>
303 Adam Petersen has written a book called <a href="http://www.adampetersen.se/articles/lispweb.htm">"Lisp for
304 the Web"</a> which explains how Hunchentoot and some other
305 libraries can be used to build web sites.
306 </p>
308 Here is some software which extends Hunchentoot or is based on it:
309 </p>
310 <ul>
311 <li>
312 <a href="http://weblocks-framework.info/">Weblocks</a> by
313 Slava Akhmechet is a "continuations-based web framework" which
314 is based on Hunchentoot.
315 </li>
316 <li>
317 <a href="https://github.com/slyrus/hunchentoot-cgi">hunchentoot-cgi</a>
318 (by Cyrus Harmon) provides
319 <a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface">CGI</a>
320 handlers for Hunchentoot.
321 </li>
322 <li>
323 <a href="http://weitz.de/cl-webdav/">CL-WEBDAV</a> is a <a href="http://webdav.org/">WebDAV</a>
324 server based on Hunchentoot.
325 </li>
326 <li>
327 <a href="http://restas.lisper.ru/">RESTAS</a> is a web
328 framework based on Hunchentoot.
329 </li>
330 </ul>
333 <h3 xmlns=""><a class="none" name="reference">Function and variable reference</a></h3>
335 <h4 xmlns=""><a name="acceptors">Acceptors</a></h4>
337 If you want Hunchentoot to actually do something, you have to create and
338 <a href="#start">start</a> an <a href="#acceptor">acceptor</a>.
339 You can also run several acceptors in one image, each one
340 listening on a different different port.
342 <p xmlns=""><a class="none" name="acceptor"></a>
343 [Standard class]
344 <br><b>acceptor</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
345 To create a Hunchentoot webserver, you make an instance of
346 this class or one of its subclasses and use the generic
347 function <code><a href="#start">START</a></code> to start it (and
348 <code><a href="#stop">STOP</a></code> to stop it). Use the
349 <code xmlns="http://www.w3.org/1999/xhtml">:port</code> initarg if you don't want to listen
350 on the default http port 80. There are other initargs most
351 of which you probably won't need very often. They are
352 explained in detail in the docstrings of the slot
353 definitions for this class.
354 <p xmlns="http://www.w3.org/1999/xhtml">
355 Unless you are in a Lisp without MP capabilities, you can
356 have several active instances of
357 <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> (listening on different
358 ports) at the same time.
359 </p>
360 </clix:description></blockquote></p>
362 <p xmlns=""><a class="none" name="ssl-acceptor"></a>
363 [Standard class]
364 <br><b>ssl-acceptor</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Create and <code><a href="#start">START</a></code> an instance of this class
365 (instead of <code><a href="#acceptor">ACCEPTOR</a></code>) if you want an https server. There are two
366 required initargs, <code xmlns="http://www.w3.org/1999/xhtml">:SSL-CERTIFICATE-FILE</code> and <code xmlns="http://www.w3.org/1999/xhtml">:SSL-PRIVATEKEY-FILE</code>, for
367 pathname designators denoting the certificate file and the key file in
368 PEM format. On LispWorks, you can have both in one file in which case
369 the second initarg is optional. You can also use the
370 <code xmlns="http://www.w3.org/1999/xhtml">:SSL-PRIVATEKEY-PASSWORD</code> initarg to provide a password
371 (as a string) for the key file (or <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>, the default, for
372 no password).
373 <p xmlns="http://www.w3.org/1999/xhtml">
374 The default port for <code xmlns=""><a href="#ssl-acceptor">SSL-ACCEPTOR</a></code> instances is 443 instead of 80
375 </p>
376 </clix:description></blockquote></p>
378 <p xmlns=""><a class="none" name="start"></a>
379 [Generic function]
380 <br><b>start</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
381 </clix:lambda-list></i>
382 =&gt;
383 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">acceptor
384 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Starts <code><i>acceptor</i></code> so that it begins accepting
385 connections. Returns the acceptor.
386 </clix:description></blockquote></p>
388 <p xmlns=""><a class="none" name="stop"></a>
389 [Generic function]
390 <br><b>stop</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor &amp;key soft</clix:lambda-list></i>
391 =&gt;
392 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">acceptor
393 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Stops the <code><i>acceptor</i></code> so
394 that it no longer accepts requests. If
395 <code><i>soft</i></code> is true, and there are any requests
396 in progress, wait until all requests are fully processed, but
397 meanwhile do not accept new requests. Note that
398 <code><i>soft</i></code> must not be set when calling
399 <code><a href="#stop">stop</a></code> from within a request handler, as
400 that will deadlock.
401 </clix:description></blockquote></p>
403 <p xmlns=""><a class="none" name="*acceptor*"></a>
404 [Special variable]
405 <br><b>*acceptor*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">The current ACCEPTOR object in the context of a request.
406 </clix:description></blockquote></p>
408 <p xmlns=""><a class="none" name="acceptor-listen-backlog"></a>
409 [Generic function]
410 <br><b>acceptor-listen-backlog</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">listen-backlog
411 </clix:lambda-list></i>
412 =&gt;
413 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">number-of-pending-connections
414 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
415 Number of pending connections allowed in the listen socket
416 before the kernel rejects further incoming connections.
417 Non-LispWorks only.
418 </clix:description></blockquote></p>
420 <p xmlns="">
421 [Generic readers]<br><a class="none" name="acceptor-address"></a><b>acceptor-address</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
422 </clix:lambda-list></i>
423 =&gt;
424 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">address
425 </clix:returns></i><br><a class="none" name="acceptor-port"></a><b>acceptor-port</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
426 </clix:lambda-list></i>
427 =&gt;
428 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">port
429 </clix:returns></i><br><a class="none" name="acceptor-read-timeout"></a><b>acceptor-read-timeout</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
430 </clix:lambda-list></i>
431 =&gt;
432 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">read-timeout
433 </clix:returns></i><br><a class="none" name="acceptor-ssl-certificate-file"></a><b>acceptor-ssl-certificate-file</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">ssl-acceptor
434 </clix:lambda-list></i>
435 =&gt;
436 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">ssl-certificate-file
437 </clix:returns></i><br><a class="none" name="acceptor-ssl-privatekey-file"></a><b>acceptor-ssl-privatekey-file</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">ssl-acceptor
438 </clix:lambda-list></i>
439 =&gt;
440 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">ssl-privatekey-file
441 </clix:returns></i><br><a class="none" name="acceptor-ssl-privatekey-password"></a><b>acceptor-ssl-privatekey-password</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">ssl-acceptor
442 </clix:lambda-list></i>
443 =&gt;
444 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">ssl-privatekey-password
445 </clix:returns></i><br><a class="none" name="acceptor-write-timeout"></a><b>acceptor-write-timeout</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
446 </clix:lambda-list></i>
447 =&gt;
448 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">write-timeout
449 </clix:returns></i><br><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
450 These are readers for various slots of <code><a href="#acceptor">ACCEPTOR</a></code>
451 objects (and some of them obviously only make sense
452 for <code><a href="#ssl-acceptor">SSL-ACCEPTOR</a></code> objects). See the docstrings of
453 these slots for more information and note that there are corresponding
454 initargs for all of them.
455 </clix:description></blockquote></p>
457 <p xmlns="">
458 [Generic accessors]<br><a class="none" name="acceptor-access-log-destination"></a><b>acceptor-access-log-destination</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
459 </clix:lambda-list></i>
460 =&gt;
461 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or pathname null)
462 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-access-log-destination</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
463 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-document-root"></a><b>acceptor-document-root</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
464 </clix:lambda-list></i>
465 =&gt;
466 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or pathname null)
467 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-document-root</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
468 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-error-template-directory"></a><b>acceptor-error-template-directory</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
469 </clix:lambda-list></i>
470 =&gt;
471 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or pathname null)
472 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-error-template-directory</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
473 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-input-chunking-p"></a><b>acceptor-input-chunking-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
474 </clix:lambda-list></i>
475 =&gt;
476 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">input-chunking-p
477 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-input-chunking-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
478 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-message-log-destination"></a><b>acceptor-message-log-destination</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
479 </clix:lambda-list></i>
480 =&gt;
481 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">(or pathname null)
482 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-message-log-destination</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
483 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-name"></a><b>acceptor-name</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
484 </clix:lambda-list></i>
485 =&gt;
486 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">name
487 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-name</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
488 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-output-chunking-p"></a><b>acceptor-output-chunking-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
489 </clix:lambda-list></i>
490 =&gt;
491 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">output-chunking-p
492 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-output-chunking-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
493 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-persistent-connections-p"></a><b>acceptor-persistent-connections-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
494 </clix:lambda-list></i>
495 =&gt;
496 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">persistent-connections-p
497 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-persistent-connections-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
498 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-reply-class"></a><b>acceptor-reply-class</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
499 </clix:lambda-list></i>
500 =&gt;
501 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">reply-class
502 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-reply-class</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
503 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="acceptor-request-class"></a><b>acceptor-request-class</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
504 </clix:lambda-list></i>
505 =&gt;
506 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">request-class
507 </clix:returns></i><br><tt>(setf (</tt><b>acceptor-request-class</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
508 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
509 These are accessors for various slots of <code><a href="#acceptor">ACCEPTOR</a></code>
510 objects. See the docstrings of these slots for more information and
511 note that there are corresponding initargs for all of them.
512 </clix:description></blockquote></p>
514 <p xmlns=""><a class="none" name="acceptor-ssl-p"></a>
515 [Generic function]
516 <br><b>acceptor-ssl-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
517 </clix:lambda-list></i>
518 =&gt;
519 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">generalized-boolean
520 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Returns a true value if <code><i>acceptor</i></code> uses SSL
521 connections. The default is to unconditionally return <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> and
522 subclasses of <code><a href="#acceptor">ACCEPTOR</a></code> must specialize this method to signal that
523 they're using secure connections - see the <code><a href="#ssl-acceptor">SSL-ACCEPTOR</a></code> class.
524 </clix:description></blockquote></p>
526 <p xmlns=""><a class="none" name="*default-connection-timeout*"></a>
527 [Special variable]
528 <br><b>*default-connection-timeout*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">The default connection timeout used when an
529 acceptor is reading from and writing to a socket stream. Note that
530 some Lisps allow you to set different timeouts for reading and writing
531 and you can specify both values via initargs when you create
532 an <a xmlns="http://www.w3.org/1999/xhtml" href="#acceptors">acceptor</a>.
533 </clix:description></blockquote></p>
535 <p xmlns=""><a class="none" name="acceptor-remove-session"></a>
536 [Generic function]
537 <br><b>acceptor-remove-session</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor session
538 </clix:lambda-list></i>
539 =&gt;
540 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
541 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
542 This function is called whenever a session in
543 <code><a href="#acceptor">ACCEPTOR</a></code> is being destroyed because of
544 a session timout or an explicit
545 <code><a href="#remove-session">REMOVE-SESSION</a></code> call.
546 </clix:description></blockquote></p>
550 <h4 xmlns=""><a name="acceptor-behaviour">Customizing acceptor behaviour</a></h4>
552 If you want to modify what acceptors do, you should subclass
553 <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> (or <code xmlns=""><a href="#ssl-acceptor">SSL-ACCEPTOR</a></code>) and
554 specialize the generic functions that constitute their behaviour (see
555 example below). The life of an acceptor looks like this: It is started
556 with the function <code xmlns=""><a href="#start">START</a></code> which immediately calls
557 <code xmlns=""><a href="#start-listening">START-LISTENING</a></code> and then applies the function
558 <code xmlns=""><a href="#execute-acceptor">EXECUTE-ACCEPTOR</a></code> to its <a href="#taskmasters">taskmaster</a>. This function will eventually call
559 <code xmlns=""><a href="#accept-connections">ACCEPT-CONNECTIONS</a></code> which is responsible for setting
560 things up to wait for clients to connect. For each incoming connection
561 which comes in, <code xmlns=""><a href="#handle-incoming-connection">HANDLE-INCOMING-CONNECTION</a></code> is applied
562 to the taskmaster which will either call
563 <code xmlns=""><a href="#process-connection">PROCESS-CONNECTION</a></code> directly, or will create a thread
564 to call it. <code xmlns=""><a href="#process-connection">PROCESS-CONNECTION</a></code> calls
565 <code xmlns=""><a href="#initialize-connection-stream">INITIALIZE-CONNECTION-STREAM</a></code> before it does anything
566 else, then it selects and calls a function which handles the <a href="#requests">request</a>, and finally it sends the <a href="#replies">reply</a> to the client before it calls
567 <code xmlns=""><a href="#reset-connection-stream">RESET-CONNECTION-STREAM</a></code>. If the connection is
568 persistent, this procedure is repeated (except for the intialization step)
569 in a loop until the connection is closed. The acceptor is stopped with
570 <code xmlns=""><a href="#stop">STOP</a></code>.
573 If you just want to use the standard acceptors that come with
574 Hunchentoot, you don't need to know anything about the functions
575 listed in this section.
576 </p>
578 <p xmlns=""><a class="none" name="start-listening"></a>
579 [Generic function]
580 <br><b>start-listening</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
581 </clix:lambda-list></i>
582 =&gt;
583 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
584 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Sets up a listen socket for the given acceptor and
585 enables it to listen to incoming connections. This function is called
586 from the thread that starts the acceptor initially and may return
587 errors resulting from the listening operation (like 'address in use'
588 or similar).
589 </clix:description></blockquote></p>
591 <p xmlns=""><a class="none" name="accept-connections"></a>
592 [Generic function]
593 <br><b>accept-connections</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
594 </clix:lambda-list></i>
595 =&gt;
596 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">nil
597 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">In a loop, accepts a connection and hands it over
598 to the acceptor's taskmaster for processing using
599 <code><a href="#handle-incoming-connection">HANDLE-INCOMING-CONNECTION</a></code>. On LispWorks, this
600 function returns immediately, on other Lisps it returns only once the
601 acceptor has been stopped.
602 </clix:description></blockquote></p>
604 <p xmlns=""><a class="none" name="process-connection"></a>
605 [Generic function]
606 <br><b>process-connection</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor socket
607 </clix:lambda-list></i>
608 =&gt;
609 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">nil
610 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
611 This function is called by the taskmaster when a new client
612 connection has been established. Its arguments are the
613 <code><a href="#acceptor">ACCEPTOR</a></code> object and a LispWorks socket
614 handle or a usocket socket stream object in
615 <code><i>socket</i></code>. It reads the request headers,
616 sets up the <a xmlns="http://www.w3.org/1999/xhtml" href="#requests">request</a> and <a xmlns="http://www.w3.org/1999/xhtml" href="#replies">reply</a> objects, and hands over to
617 <code><a href="#process-request">PROCESS-REQUEST</a></code> which calls
618 <code><a href="#handle-request">HANDLE-REQUEST</a></code> to select and call a
619 handler for the request and sends its reply to the client.
620 This is done in a loop until the stream has to be closed or
621 until a connection timeout occurs. It is probably not a
622 good idea to re-implement this method until you really,
623 really know what you're doing.
624 <p xmlns="http://www.w3.org/1999/xhtml">
625 Handlers may call to the
626 <code xmlns=""><a href="#detach-socket">DETACH-SOCKET</a></code> generic function to
627 indicate that no further requests should be handled on
628 the connection by Hunchentoot, and that responsibility for
629 the socket is assumed by third-party software. This can
630 be used by specialized handlers that wish to hand over
631 connection polling or processing to functions outside of
632 Hunchentoot, i.e. for connection multiplexing or
633 implementing specialized client protocols. Hunchentoot
634 will finish processing the request and the
635 <code xmlns=""><a href="#process-connection">PROCESS-CONNECTION</a></code> function will
636 return without closing the connection. At that point,
637 the acceptor may interact with the socket in whatever
638 fashion required.
639 </p>
640 </clix:description></blockquote></p>
642 <p xmlns=""><a class="none" name="detach-socket"></a>
643 [Generic function]
644 <br><b>detach-socket</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
645 </clix:lambda-list></i>
646 =&gt;
647 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">stream
648 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
649 Indicate to Hunchentoot that it should stop serving requests
650 on the current request's socket. Hunchentoot will finish
651 processing the current request and then return from
652 <code><a href="#process-connection">PROCESS-CONNECTION</a></code> without closing the
653 connection to the client.
654 <code><a href="#detach-socket">DETACH-SOCKET</a></code> can only be called from
655 within a request handler function.
656 </clix:description></blockquote></p>
658 <p xmlns=""><a class="none" name="initialize-connection-stream"></a>
659 [Generic function]
660 <br><b>initialize-connection-stream</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor stream
661 </clix:lambda-list></i>
662 =&gt;
663 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">stream
664 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
665 Can be used to modify the stream which is used to
666 communicate between client and server before the request is
667 read. The default method of <code><a href="#acceptor">ACCEPTOR</a></code>
668 does nothing, but see for example the method defined for
669 <code><a href="#ssl-acceptor">SSL-ACCEPTOR</a></code>. All methods of this
670 generic function <em xmlns="http://www.w3.org/1999/xhtml">must</em> return the stream to use.
671 </clix:description></blockquote></p>
673 <p xmlns=""><a class="none" name="reset-connection-stream"></a>
674 [Generic function]
675 <br><b>reset-connection-stream</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor stream
676 </clix:lambda-list></i>
677 =&gt;
678 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">stream
679 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
680 Resets the stream which is used to communicate
681 between client and server after one request has been served so that it
682 can be used to process the next request. This generic function is
683 called after a request has been processed and <em xmlns="http://www.w3.org/1999/xhtml">must</em> return the
684 stream.
685 </clix:description></blockquote></p>
687 <p xmlns=""><a class="none" name="acceptor-log-access"></a>
688 [Generic function]
689 <br><b>acceptor-log-access</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor &amp;key return-code</clix:lambda-list></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
690 Function to call to log access to the acceptor. The
691 <code><i>return-code</i></code> keyword argument contains additional
692 information about the request to log. In addition, it can use the
693 standard request and reply accessor functions that are available to
694 handler functions to find out more information about the request.
695 </clix:description></blockquote></p>
697 <p xmlns=""><a class="none" name="acceptor-log-message"></a>
698 [Generic function]
699 <br><b>acceptor-log-message</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor log-level format-string &amp;rest format-arguments</clix:lambda-list></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
700 Function to call to log messages by the <code><i>acceptor</i></code>. It must accept
701 a severity level for the message, which will be one of :ERROR, :INFO,
702 or :WARNING, a format string and an arbitary number of formatting
703 arguments.
704 </clix:description></blockquote></p>
706 <p xmlns=""><a class="none" name="acceptor-status-message"></a>
707 [Generic function]
708 <br><b>acceptor-status-message</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor http-return-code &amp;key &amp;allow-other-keys</clix:lambda-list></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
709 This function is called when a request's handler has been
710 called but failed to provide content to send back to the
711 client. It converts the
712 <code><i>HTTP-STATUS-CODE</i></code> to some request
713 contents, typically a human readable description of the
714 status code to be displayed to the user.
716 If an ERROR-TEMPLATE-DIRECTORY is set in the current
717 acceptor and the directory contains a file corresponding to
718 HTTP-STATUS-CODE named &lt;code&gt;.html, that file is sent
719 to the client after variable substitution. Variables are
720 referenced by ${&lt;variable-name&gt;}.
722 Additional keyword arguments may be provided which are made
723 available to the templating logic as substitution variables.
724 These variables can be interpolated into error message
725 templates in, which contains the current URL relative to the
726 server and without GET parameters.
728 In addition to the variables corresponding to keyword
729 arguments, the script-name, lisp-implementation-type,
730 lisp-implementation-version and hunchentoot-version
731 variables are available.
732 </clix:description></blockquote></p>
735 <h4 xmlns=""><a name="subclassing-acceptors">An example of how to subclass ACCEPTOR</a></h4>
737 This example shows how to subclass <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> in order to
738 provide Hunchentoot with basic virtual host support.  It assumes
739 Hunchentoot is sitting behind an Internet-facing reverse-proxy web server
740 that maps the host (or domain) part of incoming HTTP requests to unique
741 localhost ports.
743 <pre>(asdf:load-system "hunchentoot")
744 (asdf:load-system "drakma")
746 ;;; Subclass ACCEPTOR
747 (defclass vhost (tbnl:acceptor)
748 ;; slots
749 ((dispatch-table
750 :initform '()
751 :accessor dispatch-table
752 :documentation "List of dispatch functions"))
753 ;; options
754 (:default-initargs ; default-initargs must be used
755 :address "127.0.0.1")) ; because ACCEPTOR uses it
757 ;;; Specialise ACCEPTOR-DISPATCH-REQUEST for VHOSTs
758 (defmethod tbnl:acceptor-dispatch-request ((vhost vhost) request)
759 ;; try REQUEST on each dispatcher in turn
760 (mapc (lambda (dispatcher)
761 (let ((handler (funcall dispatcher request)))
762 (when handler ; Handler found. FUNCALL it and return result
763 (return-from tbnl:acceptor-dispatch-request (funcall handler)))))
764 (dispatch-table vhost))
765 (call-next-method))
767 ;;; ======================================================================
768 ;;; Now all we need to do is test it
770 ;;; Instantiate VHOSTs
771 (defvar vhost1 (make-instance 'vhost :port 50001))
772 (defvar vhost2 (make-instance 'vhost :port 50002))
774 ;;; Populate each dispatch table
775 (push
776 (tbnl:create-prefix-dispatcher "/foo" 'foo1)
777 (dispatch-table vhost1))
778 (push
779 (tbnl:create-prefix-dispatcher "/foo" 'foo2)
780 (dispatch-table vhost2))
782 ;;; Define handlers
783 (defun foo1 () "Hello")
784 (defun foo2 () "Goodbye")
786 ;;; Start VHOSTs
787 (tbnl:start vhost1)
788 (tbnl:start vhost2)
790 ;;; Make some requests
791 (drakma:http-request "http://127.0.0.1:50001/foo")
792 ;;; =|
793 ;;; 127.0.0.1 - [2012-06-08 14:30:39] "GET /foo HTTP/1.1" 200 5 "-" "Drakma/1.2.6 (SBCL 1.0.56; Linux; 2.6.32-5-686; http://weitz.de/drakma/)"
794 ;;; =&gt;
795 ;;; "Hello"
796 ;;; 200
797 ;;; ((:CONTENT-LENGTH . "5") (:DATE . "Fri, 08 Jun 2012 14:30:39 GMT")
798 ;;; (:SERVER . "Hunchentoot 1.2.3") (:CONNECTION . "Close")
799 ;;; (:CONTENT-TYPE . "text/html; charset=utf-8"))
800 ;;; #&lt;PURI:URI http://127.0.0.1:50001/foo&gt;
801 ;;; #&lt;FLEXI-STREAMS:FLEXI-IO-STREAM {CA90059}&gt;
802 ;;; T
803 ;;; "OK"
804 (drakma:http-request "http://127.0.0.1:50002/foo")
805 ;;; =|
806 ;;; 127.0.0.1 - [2012-06-08 14:30:47] "GET /foo HTTP/1.1" 200 7 "-" "Drakma/1.2.6 (SBCL 1.0.56; Linux; 2.6.32-5-686; http://weitz.de/drakma/)"
807 ;;; =&gt;
808 ;;; "Goodbye"
809 ;;; 200
810 ;;; ((:CONTENT-LENGTH . "7") (:DATE . "Fri, 08 Jun 2012 14:30:47 GMT")
811 ;;; (:SERVER . "Hunchentoot 1.2.3") (:CONNECTION . "Close")
812 ;;; (:CONTENT-TYPE . "text/html; charset=utf-8"))
813 ;;; #&lt;PURI:URI http://127.0.0.1:50002/foo&gt;
814 ;;; #&lt;FLEXI-STREAMS:FLEXI-IO-STREAM {CAE8059}&gt;
815 ;;; T
816 ;;; "OK"</pre>
818 How to make each VHOST write to separate access log streams (or files) is
819 left as an exercise to the reader.
823 <h4 xmlns=""><a name="taskmasters">Taskmasters</a></h4>
824 As a "normal" Hunchentoot user, you can completely ignore
825 taskmasters and skip this section. But if you're still reading,
826 here are the dirty details: Each <a href="#acceptors">acceptor</a> has a taskmaster associated with
827 it at creation time. It is the taskmaster's job to distribute
828 the work of accepting and handling incoming connections. The
829 acceptor calls the taskmaster if appropriate and the taskmaster
830 calls back into the acceptor. This is done using the generic
831 functions described in this and the <a href="#acceptor-behaviour">previous</a> section. Hunchentoot
832 comes with two standard taskmaster implementations - one (which
833 is the default used on multi-threaded Lisps) which starts a new
834 thread for each incoming connection and one which handles all
835 requests sequentially. It should for example be relatively
836 straightforward to create a taskmaster which allocates threads
837 from a fixed pool instead of creating a new one for each
838 connection.
841 You can control the resources consumed by a threaded taskmaster via
842 two initargs. <code>:max-thread-count</code> lets you set the maximum
843 number of request threads that can be processes simultaneously. If
844 this is <code>nil</code>, the is no thread limit imposed.
846 <code>:max-accept-count</code> lets you set the maximum number of requests
847 that can be outstanding (i.e. being processed or queued for processing).
849 If <code>:max-thread-count</code> is supplied and <code>:max-accept-count</code>
850 is <code>NIL</code>, then a <code xmlns=""><a href="#+http-service-unavailable+">+HTTP-SERVICE-UNAVAILABLE+</a></code>
851 error will be generated if there are more than the max-thread-count
852 threads processing requests. If both <code>:max-thread-count</code>
853 and <code>:max-accept-count</code> are supplied, then max-thread-count
854 must be less than max-accept-count; if more than max-thread-count
855 requests are being processed, then requests up to max-accept-count
856 will be queued until a thread becomes available. If more than
857 max-accept-count requests are outstanding, then a <code xmlns=""><a href="#+http-service-unavailable+">+HTTP-SERVICE-UNAVAILABLE+</a></code>
858 error will be generated.
860 In a load-balanced environment with multiple Hunchentoot servers, it's
861 reasonable to provide <code>:max-thread-count</code> but leave
862 <code>:max-accept-count</code> null. This will immediately result
863 in <code xmlns=""><a href="#+http-service-unavailable+">+HTTP-SERVICE-UNAVAILABLE+</a></code> when one server is
864 out of resources, so the load balancer can try to find another server.
866 In an environment with a single Hunchentoot server, it's reasonable
867 to provide both <code>:max-thread-count</code> and a somewhat larger value
868 for <code>:max-accept-count</code>. This will cause a server that's almost
869 out of resources to wait a bit; if the server is completely out of resources,
870 then the reply will be <code xmlns=""><a href="#+http-service-unavailable+">+HTTP-SERVICE-UNAVAILABLE+</a></code>.
871 The default for these values is 100 and 120, respectively.
872 </p>
875 If you want to implement your own taskmasters, you should subclass
876 <code xmlns=""><a href="#taskmaster">TASKMASTER</a></code> or one of its subclasses,
877 <code xmlns=""><a href="#single-threaded-taskmaster">SINGLE-THREADED-TASKMASTER</a></code> or
878 <code xmlns=""><a href="#one-thread-per-connection-taskmaster">ONE-THREAD-PER-CONNECTION-TASKMASTER</a></code>, and
879 specialize the generic functions in this section.
880 </p>
882 <p xmlns=""><a class="none" name="taskmaster"></a>
883 [Standard class]
884 <br><b>taskmaster</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
885 An instance of this class is responsible for distributing
886 the work of handling requests for its acceptor. This is an
887 "abstract" class in the sense that usually only instances of
888 subclasses of <code><a href="#taskmaster">TASKMASTER</a></code> will be used.
889 </clix:description></blockquote></p>
891 <p xmlns=""><a class="none" name="one-thread-per-connection-taskmaster"></a>
892 [Standard class]
893 <br><b>one-thread-per-connection-taskmaster</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
894 A taskmaster that starts one thread for listening to
895 incoming requests and one thread for each incoming
896 connection.
897 <p xmlns="http://www.w3.org/1999/xhtml">
898 This is the default taskmaster implementation for multi-threaded Lisp
899 implementations.
900 </p>
901 </clix:description></blockquote></p>
903 <p xmlns=""><a class="none" name="single-threaded-taskmaster"></a>
904 [Standard class]
905 <br><b>single-threaded-taskmaster</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
906 A taskmaster that runs synchronously in the
907 thread where the <code><a href="#start">START</a></code> function was invoked (or
908 in the case of LispWorks in the thread started
909 by <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/lw51/LWRM/html/lwref-61.htm#marker-910861"><code>COMM:START-UP-SERVER</code></a>).
910 This is the simplest possible taskmaster implementation in that its
911 methods do nothing but calling their acceptor "sister"
912 methods - <code><a href="#execute-acceptor">EXECUTE-ACCEPTOR</a></code> calls <code><a href="#accept-connections">ACCEPT-CONNECTIONS</a></code>,
913 <code><a href="#handle-incoming-connection">HANDLE-INCOMING-CONNECTION</a></code> calls <code><a href="#process-connection">PROCESS-CONNECTION</a></code>.
914 </clix:description></blockquote></p>
916 <p xmlns=""><a class="none" name="multi-threaded-taskmaster"></a>
917 [Standard class]
918 <br><b>multi-threaded-taskmaster</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
919 This is an abstract class for taskmasters that use multiple threads;
920 it is not a concrete class and you should not instantiate it with
921 <code xmlns="http://www.w3.org/1999/xhtml">MAKE-INSTANCE</code>.
922 Instead, you should instantiate its subclass
923 <code><a href="#one-thread-per-connection-taskmaster">ONE-THREAD-PER-CONNECTION-TASKMASTER</a></code> described above.
924 <code><a href="#multi-threaded-taskmaster">MULTI-THREADED-TASKMASTER</a></code>
925 is intended to be inherited from by extensions to Hunchentoot,
926 such as <a xmlns="http://www.w3.org/1999/xhtml" href="http://common-lisp.net/project/qitab/">quux-hunchentoot</a>'s
927 <code xmlns="http://www.w3.org/1999/xhtml">THREAD-POOLING-TASKMASTER</code>,
928 though at the moment, doing so only inherits one slot and one method,
929 on <code><a href="#execute-acceptor">EXECUTE-ACCEPTOR</a></code>,
930 to have it start a new thread for the acceptor,
931 then saved in said slot.
932 </clix:description></blockquote></p>
934 <p xmlns=""><a class="none" name="execute-acceptor"></a>
935 [Generic function]
936 <br><b>execute-acceptor</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">taskmaster
937 </clix:lambda-list></i>
938 =&gt;
939 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
940 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">This is a callback called by the acceptor once it
941 has performed all initial processing to start listening for incoming
942 connections (see <code><a href="#start-listening">START-LISTENING</a></code>). It usually calls the
943 <code><a href="#accept-connections">ACCEPT-CONNECTIONS</a></code> method of the acceptor, but depending on the
944 taskmaster instance the method might be called from a new thread.
945 </clix:description></blockquote></p>
947 <p xmlns=""><a class="none" name="handle-incoming-connection"></a>
948 [Generic function]
949 <br><b>handle-incoming-connection</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">taskmaster socket
950 </clix:lambda-list></i>
951 =&gt;
952 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
953 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
954 This function is called by the acceptor to start
955 processing of requests on a new incoming connection. <code><i>socket</i></code> is the
956 usocket instance that represents the new connection (or a socket
957 handle on LispWorks). The taskmaster starts processing requests on
958 the incoming connection by calling the <code><a href="#process-connection">PROCESS-CONNECTION</a></code>
959 method of the acceptor instance. The <code><i>socket</i></code> argument is passed to
960 <code><a href="#process-connection">PROCESS-CONNECTION</a></code> as an argument.
962 If the taskmaster is a multi-threaded taskmaster, <code><a href="#handle-incoming-thread">HANDLE-INCOMING-THREAD</a></code>
963 will call <code><a href="#create-request-handler-thread">CREATE-REQUEST-HANDLER-THREAD</a></code>, which will call
964 <code><a href="#process-connection">PROCESS-CONNECTION</a></code> in a new thread.
965 <code><a href="#handle-incoming-thread">HANDLE-INCOMING-THREAD</a></code> might issue a
966 <code><a href="#+http-service-unavailable+">+HTTP-SERVICE-UNAVAILABLE+</a></code> error
967 if there are too many request threads or it might block waiting for a
968 request thread to finish.
969 </clix:description></blockquote></p>
971 <p xmlns=""><a class="none" name="start-thread"></a>
972 [Generic function]
973 <br><b>start-thread</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">taskmaster thunk &amp;key
974 </clix:lambda-list></i>
975 =&gt;
976 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">thread
977 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">This function is a callback that
978 starts a new thread that will call the given <code><i>thunk</i></code>
979 in the context of the proper <code><i>taskmaster</i></code>,
980 with appropriate context-dependent keyword arguments.
981 <code><a href="#one-thread-per-connection-taskmaster">ONE-THREAD-PER-CONNECTION-TASKMASTER</a></code> uses it in
982 <code><a href="#execute-acceptor">EXECUTE-ACCEPTOR</a></code>
983 and <code><a href="#create-request-handler-thread">CREATE-REQUEST-HANDLER-THREAD</a></code>,
984 but specialized taskmasters may define more functions that use it.
985 By default, it just creates a thread calling the thunk
986 with a specified <code><i>name</i></code> keyword argument.
987 Specialized taskmasters may wrap special bindings and condition handlers
988 around the thunk call, register the thread in a management table, etc.
989 </clix:description></blockquote></p>
991 <p xmlns=""><a class="none" name="create-request-handler-thread"></a>
992 [Generic function]
993 <br><b>create-request-handler-thread</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">taskmaster socket
994 </clix:lambda-list></i>
995 =&gt;
996 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">thread
997 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">This function is called by <code><a href="#handle-incoming-thread">HANDLE-INCOMING-THREAD</a></code>
998 to create a new thread which calls <code><a href="#process-connection">PROCESS-CONNECTION</a></code>.
999 If you specialize this function, you must be careful to have the thread
1000 call <code><a href="#decrement-taskmaster-request-count">DECREMENT-TASKMASTER-REQUEST-COUNT</a></code> before
1001 it exits. A typical method will look like this:
1003 <pre xmlns="http://www.w3.org/1999/xhtml">(defmethod create-request-handler-thread ((taskmaster monitor-taskmaster) socket)
1004 (bt:make-thread
1005 (lambda ()
1006 (with-monitor-error-handlers
1007 (unwind-protect
1008 (with-monitor-variable-bindings
1009 (process-connection (taskmaster-acceptor taskmaster) socket))
1010 (decrement-taskmaster-request-count taskmaster))))))</pre>
1018 </clix:description></blockquote></p>
1020 <p xmlns=""><a class="none" name="shutdown"></a>
1021 [Generic function]
1022 <br><b>shutdown</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">taskmaster
1023 </clix:lambda-list></i>
1024 =&gt;
1025 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">taskmaster
1026 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Shuts down the taskmaster, i.e. frees all resources
1027 that were set up by it. For example, a multi-threaded taskmaster
1028 might terminate all threads that are currently associated with it.
1029 This function is called by the acceptor's <code><a href="#stop">STOP</a></code> method.
1030 </clix:description></blockquote></p>
1032 <p xmlns=""><a class="none" name="taskmaster-acceptor"></a>
1033 [Generic accessor]
1034 <br><b>taskmaster-acceptor</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">taskmaster
1035 </clix:lambda-list></i>
1036 =&gt;
1037 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">acceptor
1038 </clix:returns></i><br><tt>(setf (</tt><b>taskmaster-acceptor</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">taskmaster
1039 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1040 This is an accessor for the slot of a <code><a href="#taskmaster">TASKMASTER</a></code>
1041 object that links back to the <a xmlns="http://www.w3.org/1999/xhtml" href="#acceptors">acceptor</a> it is
1042 associated with.
1043 </clix:description></blockquote></p>
1047 <h4 xmlns=""><a name="request-dispatch">Request dispatch and handling</a></h4>
1049 The main job of <code xmlns=""><a href="#handle-request">HANDLE-REQUEST</a></code> is to select
1050 and call a function which handles the request, i.e. which looks
1051 at the data the client has sent and prepares an appropriate
1052 reply to send back. This is by default implemented as follows:
1054 The ACCEPTOR class defines a
1055 <code xmlns=""><a href="#acceptor-dispatch-request">ACCEPTOR-DISPATCH-REQUEST</a></code> generic
1056 function which is used to actually dispatch the request. This
1057 function is called by the default method of
1058 <code xmlns=""><a href="#handle-request">HANDLE-REQUEST</a></code>. Each
1059 <code xmlns=""><a href="#acceptor-dispatch-request">ACCEPTOR-DISPATCH-REQUEST</a></code> method looks at
1060 the request object and depending on its contents decides to
1061 either handle the request or call the next method.
1062 </p>
1064 In order to dispatch a request, Hunchentoot calls the
1065 <code xmlns=""><a href="#acceptor-dispatch-request">ACCEPTOR-DISPATCH-REQUEST</a></code> generic
1066 functions. The method for <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> tries
1067 to serve a static file relative to it's
1068 <code xmlns=""><a href="#acceptor-document-root">ACCEPTOR-DOCUMENT-ROOT</a></code>. Application
1069 specific acceptor subclasses will typically perform URL
1070 parsing and dispatching according to the policy that is
1071 required.
1072 </p>
1074 The default method of <code xmlns=""><a href="#handle-request">HANDLE-REQUEST</a></code> sets
1075 up <a href="#logging">standard logging and error handling</a>
1076 before it calls the acceptor's request dispatcher.
1077 </p>
1079 Request handlers do their work by modifying
1080 the <a href="#replies">reply object</a> if necessary and by eventually
1081 returning the response body in the form of a string or a binary
1082 sequence. As an alternative, they can also
1083 call <code xmlns=""><a href="#send-headers">SEND-HEADERS</a></code> and write directly to a stream.
1084 </p>
1087 <h4 xmlns=""><a name="easy-handlers">Using the easy-handler framework</a></h4>
1089 The <code xmlns=""><a href="#easy-acceptor">EASY-ACCEPTOR</a></code> class defines a method
1090 for <code xmlns=""><a href="#acceptor-dispatch-request">ACCEPTOR-DISPATCH-REQUEST</a></code> that walks
1091 through the list <code xmlns=""><a href="#*dispatch-table*">*DISPATCH-TABLE*</a></code> which
1092 consists of <em>dispatch functions</em>. Each of these
1093 functions accepts the request object as its only argument and
1094 either returns a request handler to handle the request or
1095 <code>NIL</code> which means that the next dispatcher in the
1096 list will be tried. If all dispatch functions return
1097 <code>NIL</code>, the next
1098 <code xmlns=""><a href="#acceptor-dispatch-request">ACCEPTOR-DISPATCH-REQUEST</a></code> will be called.
1099 </p>
1101 All functions and variables in this section are related to the
1102 easy request dispatch mechanism and are meaningless if you're
1103 using your own request dispatcher.
1104 </p>
1106 <p xmlns=""><a class="none" name="easy-acceptor"></a>
1107 [Standard class]
1108 <br><b>easy-acceptor</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1109 This class defines no additional slots with respect to
1110 <code><a href="#acceptor">ACCEPTOR</a></code>. It only serves as an
1111 additional type for dispatching calls to
1112 <code><a href="#acceptor-dispatch-request">ACCEPTOR-DISPATCH-REQUEST</a></code>. In order to
1113 use the easy handler framework, acceptors of this class or
1114 one of its subclasses must be used.
1115 </clix:description></blockquote></p>
1117 <p xmlns=""><a class="none" name="easy-ssl-acceptor"></a>
1118 [Standard class]
1119 <br><b>easy-ssl-acceptor</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1120 This class mixes the <code><a href="#ssl-acceptor">SSL-ACCEPTOR</a></code> and
1121 the <code><a href="#easy-acceptor">EASY-ACCEPTOR</a></code> classes. It is used
1122 when both ssl and the easy handler framework are required.
1123 </clix:description></blockquote></p>
1125 <p xmlns=""><a class="none" name="*dispatch-table*"></a>
1126 [Special variable]
1127 <br><b>*dispatch-table*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1128 A global list of dispatch functions. The initial value is a
1129 list consisting of the symbol
1130 <code><a href="#dispatch-easy-handlers">DISPATCH-EASY-HANDLERS</a></code>.
1131 </clix:description></blockquote></p>
1133 <p xmlns=""><a class="none" name="create-prefix-dispatcher"></a>
1134 [Function]
1135 <br><b>create-prefix-dispatcher</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">prefix handler</clix:lambda-list></i>
1136 =&gt;
1137 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">dispatch-fn</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1138 A convenience function which will return a dispatcher that
1139 returns <code><i>handler</i></code> whenever the path part of
1140 the request URI starts with the
1141 string <code><i>prefix</i></code>.
1142 </clix:description></blockquote></p>
1144 <p xmlns=""><a class="none" name="create-regex-dispatcher"></a>
1145 [Function]
1146 <br><b>create-regex-dispatcher</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">regex handler</clix:lambda-list></i>
1147 =&gt;
1148 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">dispatch-fn</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1149 A convenience function which will return a dispatcher that
1150 returns <code><i>handler</i></code> whenever the path part of
1151 the request URI matches
1152 the <a xmlns="http://www.w3.org/1999/xhtml" href="http://weitz.de/cl-ppcre/">CL-PPCRE</a> regular
1153 expression <code><i>regex</i></code> (which can be a string, an
1154 s-expression, or a scanner).
1155 </clix:description></blockquote></p>
1157 <p xmlns=""><a class="none" name="create-folder-dispatcher-and-handler"></a>
1158 [Function]
1159 <br><b>create-folder-dispatcher-and-handler</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">uri-prefix base-path <tt>&amp;optional</tt> content-type</clix:lambda-list></i>
1160 =&gt;
1161 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">dispatch-fn</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1162 Creates and returns a dispatch function which will dispatch to
1163 a handler function which emits the file relative
1164 to <code><i>base-path</i></code> that is denoted by the URI of
1165 the request relative
1166 to <code><i>uri-prefix</i></code>. <code><i>uri-prefix</i></code>
1167 must be a string ending with a
1168 slash, <code><i>base-path</i></code> must be a pathname
1169 designator for an existing directory.
1170 Uses <code><a href="#handle-static-file">HANDLE-STATIC-FILE</a></code> internally.
1171 <p xmlns="http://www.w3.org/1999/xhtml">
1172 If <code xmlns=""><i>content-type</i></code> is <em>not</em>
1173 <code>NIL</code>, it will be used as a the content type for
1174 all files in the folder. Otherwise (which is the default)
1175 the content type of each file will be
1176 determined <a href="#handle-static-file">as usual</a>.
1177 </p>
1178 </clix:description></blockquote></p>
1180 <p xmlns=""><a class="none" name="create-static-file-dispatcher-and-handler"></a>
1181 [Function]
1182 <br><b>create-static-file-dispatcher-and-handler</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">uri path
1183 <tt>&amp;optional
1184 </tt> content-type
1185 </clix:lambda-list></i>
1186 =&gt;
1187 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
1188 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1189 Creates and returns a request dispatch function which will
1190 dispatch to a handler function which emits the file denoted
1191 by the pathname designator PATH with content type
1192 CONTENT-TYPE if the SCRIPT-NAME of the request matches the
1193 string URI. If CONTENT-TYPE is NIL, tries to determine the
1194 content type via the file's suffix.
1195 </clix:description></blockquote></p>
1197 <p xmlns=""><a class="none" name="define-easy-handler"></a>
1198 [Macro]
1199 <br><b>define-easy-handler</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">description lambda-list [[declaration* | documentation]] form*</clix:lambda-list></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1200 Defines a handler as if
1201 by <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/m_defun.htm">
1202 <code>DEFUN</code></a> and optionally registers it with a
1203 URI so that it will be found
1204 by <code><a href="#dispatch-easy-handlers">DISPATCH-EASY-HANDLERS</a></code>.
1205 <p xmlns="http://www.w3.org/1999/xhtml">
1206 <code xmlns=""><i>description</i></code> is either a
1207 symbol <code xmlns=""><i>name</i></code> or a list matching the
1208 <a href="http://www.lispworks.com/documentation/HyperSpec/Body/03_de.htm">destructuring
1209 lambda list</a>
1210 </p>
1211 <pre xmlns="http://www.w3.org/1999/xhtml">(name &amp;key uri acceptor-names default-parameter-type default-request-type).</pre>
1212 <code><i>lambda-list</i></code> is a list the elements of which
1213 are either a symbol <code><i>var</i></code> or a list matching
1214 the destructuring lambda list
1215 <pre xmlns="http://www.w3.org/1999/xhtml">(var &amp;key real-name parameter-type init-form request-type).</pre>
1216 The resulting handler will be a Lisp function with the
1217 name <code><i>name</i></code> and keyword parameters named by
1218 the <code><i>var</i></code> symbols.
1219 Each <code><i>var</i></code> will be bound to the value of the
1220 GET or POST parameter called <code><i>real-name</i></code> (a
1221 string) before the body of the function is executed.
1222 If <code><i>real-name</i></code> is not provided, it will be
1223 computed
1224 by <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm#string-downcase">downcasing</a>
1225 the symbol name of <code><i>var</i></code>.
1226 <p xmlns="http://www.w3.org/1999/xhtml">
1227 If <code xmlns=""><i>uri</i></code> (which is evaluated) is provided,
1228 then it must be a string or
1229 a <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#function_designator">function
1230 designator</a> for a unary function. In this case, the
1231 handler will be returned
1232 by <code xmlns=""><a href="#dispatch-easy-handlers">DISPATCH-EASY-HANDLERS</a></code>,
1233 if <code xmlns=""><i>uri</i></code> is a string and
1234 the <a href="#script-name">script name</a> of the current
1235 request is <code xmlns=""><i>uri</i></code>, or
1236 if <code xmlns=""><i>uri</i></code> designates a function and applying
1237 this function to
1238 the <a href="#*request*">current <code>REQUEST</code>
1239 object</a> returns a true value.
1240 </p>
1241 <p xmlns="http://www.w3.org/1999/xhtml">
1242 <code xmlns=""><i>acceptor-names</i></code> (which is evaluated) can be a
1243 list of symbols which means that the handler will only be
1244 returned by <code xmlns=""><a href="#dispatch-easy-handlers">DISPATCH-EASY-HANDLERS</a></code> in
1245 acceptors which have one of these names
1246 (see <code xmlns=""><a href="#acceptor-name">ACCEPTOR-NAME</a></code>). <code xmlns=""><i>acceptor-names</i></code> can also be the
1247 symbol <code>T</code> which means that the handler will be
1248 returned by <code xmlns=""><a href="#dispatch-easy-handlers">DISPATCH-EASY-HANDLERS</a></code>
1249 in <em>every</em> acceptor.
1250 </p>
1251 <p xmlns="http://www.w3.org/1999/xhtml">
1252 Whether the GET or POST parameter (or both) will be taken into
1253 consideration, depends on <code xmlns=""><i>request-type</i></code>
1254 which can
1255 be <code>:GET</code>, <code>:POST</code>, <code>:BOTH</code>,
1256 or <code>NIL</code>. In the last case, the value of
1257 <code xmlns=""><i>default-request-type</i></code> (the default of which
1258 is <code>:BOTH</code>) will be used.
1259 </p>
1260 <p xmlns="http://www.w3.org/1999/xhtml">
1261 The value of <code xmlns=""><i>var</i></code> will usually be a string
1262 (unless it resulted from a <a href="#upload">file upload</a>
1263 in which case it won't be converted at all), but
1264 if <code xmlns=""><i>parameter-type</i></code> (which is evaluated) is
1265 provided, the string will be converted to another Lisp type by
1266 the following rules:
1267 </p>
1268 <p xmlns="http://www.w3.org/1999/xhtml">
1269 If the corresponding GET or POST parameter wasn't provided by
1270 the client, <code xmlns=""><i>var</i></code>'s value will
1271 be <code>NIL</code>. If <code xmlns=""><i>parameter-type</i></code>
1272 is <code>'STRING</code>,
1273 <code xmlns=""><i>var</i></code>'s value remains as is.
1274 If <code xmlns=""><i>parameter-type</i></code> is <code>'INTEGER</code>
1275 and the parameter string consists solely of decimal
1276 digits, <code xmlns=""><i>var</i></code>'s value will be the
1277 corresponding integer, otherwise <code>NIL</code>.
1278 If <code xmlns=""><i>parameter-type</i></code> is
1279 <code>'KEYWORD</code>, <code xmlns=""><i>var</i></code>'s value will be
1280 the keyword obtained
1281 by <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_intern.htm">interning</a>
1282 the <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm#string-upcase">upcased</a>
1283 parameter string into
1284 the <a href="http://www.lispworks.com/documentation/HyperSpec/Body/11_abc.htm">keyword
1285 package</a>. If <code xmlns=""><i>parameter-type</i></code>
1286 is <code>'CHARACTER</code> and the parameter string is of
1287 length one, <code xmlns=""><i>var</i></code>'s value will be the single
1288 character of this string, otherwise <code>NIL</code>.
1289 If <code xmlns=""><i>parameter-type</i></code>
1290 is <code>'BOOLEAN</code>, <code xmlns=""><i>var</i></code>'s value will
1291 always be <code>T</code> (unless it is <code>NIL</code> by the
1292 first rule above, of course).
1293 If <code xmlns=""><i>parameter-type</i></code> is any other atom, it is
1294 supposed to be
1295 a <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#function_designator">function
1296 designator</a> for a unary function which will be called to
1297 convert the string to something else.
1298 </p>
1299 <p xmlns="http://www.w3.org/1999/xhtml">
1300 Those were the rules for <em>simple</em> parameter types, but
1301 <code xmlns=""><i>parameter-type</i></code> can also be a list starting
1302 with one of the symbols
1303 <code>LIST</code>, <code>ARRAY</code>,
1304 or <code>HASH-TABLE</code>. The second value of the list must
1305 always be a simple parameter type as in the last paragraph -
1306 we'll call it the <em>inner type</em> below.
1307 </p>
1308 <p xmlns="http://www.w3.org/1999/xhtml">
1309 In the case of <code>'LIST</code>, all GET/POST parameters
1310 called <code xmlns=""><i>real-name</i></code> will be collected,
1311 converted to the inner type as by the rules above, and
1312 assembled into a list which will be the value of
1313 <code xmlns=""><i>var</i></code>.
1314 </p>
1315 <p xmlns="http://www.w3.org/1999/xhtml">
1316 In the case of <code>'ARRAY</code>, all GET/POST parameters
1317 which have a name like the result of
1318 </p>
1319 <pre xmlns="http://www.w3.org/1999/xhtml">(format nil "~A[~A]" real-name n)</pre>
1320 where <code><i>n</i></code> is a non-negative integer, will be
1321 assembled into an array where the <code><i>n</i></code>th element
1322 will be set accordingly, after conversion to the inner type.
1323 The array, which will become the value
1324 of <code><i>var</i></code>, will be big enough to hold all
1325 matching parameters, but not bigger. Array elements not set as
1326 described above will be <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>. Note
1327 that <code xmlns="http://www.w3.org/1999/xhtml">VAR</code> will always be bound to an array, which
1328 may be empty, so it will never be <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>, even if no
1329 appropriate GET/POST parameters are found.
1330 <p xmlns="http://www.w3.org/1999/xhtml">
1331 The full form of a <code>'HASH-TABLE</code> parameter type is
1332 </p>
1333 <pre xmlns="http://www.w3.org/1999/xhtml">(hash-table inner-type key-type test-function)</pre>
1334 but <code><i>key-type</i></code>
1335 and <code><i>test-function</i></code> can be left out in which
1336 case they default to <code xmlns="http://www.w3.org/1999/xhtml">'STRING</code>
1337 and <code xmlns="http://www.w3.org/1999/xhtml">'EQUAL</code>, respectively. For this parameter type,
1338 all GET/POST parameters which have a name like the result of
1339 <pre xmlns="http://www.w3.org/1999/xhtml">(format nil "~A{~A}" real-name key)</pre>
1340 (where <code><i>key</i></code> is a string that doesn't contain
1341 curly brackets) will become the values (after conversion
1342 to <code><i>inner-type</i></code>) of a hash table with test
1343 function <code><i>test-function</i></code>
1344 where <code><i>key</i></code> (after conversion
1345 to <code><i>key-type</i></code>) will be the corresponding key.
1346 Note that <code><i>var</i></code> will always be bound to a hash
1347 table, which may be empty, so it will never be <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>,
1348 even if no appropriate GET/POST parameters are found.
1349 <p xmlns="http://www.w3.org/1999/xhtml">
1350 To make matters even more complicated, the three compound
1351 parameter types also have an abbreviated form - just one of
1352 the symbols <code>LIST</code>, <code>ARRAY</code>,
1353 or <code>HASH-TABLE</code>. In this case, the inner type will
1354 default to <code>'STRING</code>.
1355 </p>
1356 <p xmlns="http://www.w3.org/1999/xhtml">
1357 If <code xmlns=""><i>parameter-type</i></code> is not provided
1358 or <code>NIL</code>, <code xmlns=""><i>default-parameter-type</i></code>
1359 (the default of which is <code>'STRING</code>) will be used
1360 instead.
1361 </p>
1362 <p xmlns="http://www.w3.org/1999/xhtml">
1363 If the result of the computations above would be
1364 that <code xmlns=""><i>var</i></code> would be bound
1365 to <code>NIL</code>, then <code xmlns=""><i>init-form</i></code> (if
1366 provided) will be evaluated instead,
1367 and <code xmlns=""><i>var</i></code> will be bound to the result of this
1368 evaluation.
1369 </p>
1370 <p xmlns="http://www.w3.org/1999/xhtml">
1371 Handlers built with this macro are constructed in such a way
1372 that the resulting Lisp function is useful even outside of
1373 Hunchentoot. Specifically, all the parameter computations
1374 above will only happen if <code xmlns=""><a href="#*request*">*REQUEST*</a></code> is
1375 bound, i.e. if we're within a Hunchentoot request.
1376 Otherwise, <code xmlns=""><i>var</i></code> will always be bound to the
1377 result of evaluating <code xmlns=""><i>init-form</i></code> unless a
1378 corresponding keyword argument is provided.
1379 </p>
1380 <p xmlns="http://www.w3.org/1999/xhtml">
1381 The <a href="#example">example code</a> that comes with
1382 Hunchentoot contains an example which demonstrates some of the
1383 features of <code xmlns=""><a href="#define-easy-handler">DEFINE-EASY-HANDLER</a></code>.
1384 </p>
1385 </clix:description></blockquote></p>
1387 <p xmlns=""><a class="none" name="dispatch-easy-handlers"></a>
1388 [Function]
1389 <br><b>dispatch-easy-handlers</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
1390 </clix:lambda-list></i>
1391 =&gt;
1392 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
1393 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">This is a dispatcher which returns the appropriate handler
1394 defined with <code><a href="#define-easy-handler">DEFINE-EASY-HANDLER</a></code>, if there is one.
1395 </clix:description></blockquote></p>
1399 <h4 xmlns=""><a name="requests">Request objects</a></h4>
1401 For each incoming request, the <a href="#acceptors">acceptor</a> (in
1402 <code xmlns=""><a href="#process-connection">PROCESS-CONNECTION</a></code>) creates a
1403 <code xmlns=""><a href="#request">REQUEST</a></code> object and makes it available to <a href="#request-dispatch">handlers</a> via the special variable
1404 <code xmlns=""><a href="#*request*">*REQUEST*</a></code>. This object contains all relevant
1405 information about the request and this section collects the functions
1406 which can be used to query such an object. In all function where
1407 <code xmlns=""><i>request</i></code> is an optional or keyword parameter, the
1408 default is <code xmlns=""><a href="#*request*">*REQUEST*</a></code>.
1411 If you need more fine-grained control over the behaviour of request
1412 objects, you can subclass <code xmlns=""><a href="#request">REQUEST</a></code> and initialize
1413 the <a href="#acceptor-request-class"><code>REQUEST-CLASS</code></a>
1414 slot of the <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> class accordingly. The
1415 acceptor will generate request objects of the class named by this
1416 slot.
1417 </p>
1419 <p xmlns=""><a class="none" name="request"></a>
1420 [Standard class]
1421 <br><b>request</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1422 Objects of this class hold all the information
1423 about an incoming request. They are created automatically by
1424 acceptors and can be accessed by the
1425 corresponding <a xmlns="http://www.w3.org/1999/xhtml" href="#request-dispatch">handler</a>.
1427 You should not mess with the slots of these objects directly, but you
1428 can subclass <code><a href="#request">REQUEST</a></code> in order to implement your
1429 own behaviour. See
1430 the <a xmlns="http://www.w3.org/1999/xhtml" href="#acceptor-request-class"><code>REQUEST-CLASS</code></a>
1431 slot of the <code><a href="#acceptor">ACCEPTOR</a></code> class.
1432 </clix:description></blockquote></p>
1434 <p xmlns=""><a class="none" name="*request*"></a>
1435 [Special variable]
1436 <br><b>*request*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">The current REQUEST object while in the context of a request.
1437 </clix:description></blockquote></p>
1439 <p xmlns=""><a class="none" name="real-remote-addr"></a>
1440 [Function]
1441 <br><b>real-remote-addr</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1442 <tt>&amp;optional
1443 </tt> request
1444 </clix:lambda-list></i>
1445 =&gt;
1446 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string{, list}
1447 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1448 Returns the '<code xmlns="http://www.w3.org/1999/xhtml">X-Forwarded-For</code>' incoming http header as the
1449 second value in the form of a list of IP addresses and the first
1450 element of this list as the first value if this header exists.
1451 Otherwise returns the value of <code><a href="#remote-addr">REMOTE-ADDR</a></code> as the only value.
1452 </clix:description></blockquote></p>
1454 <p xmlns=""><a class="none" name="parameter"></a>
1455 [Function]
1456 <br><b>parameter</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name
1457 <tt>&amp;optional
1458 </tt> request
1459 </clix:lambda-list></i>
1460 =&gt;
1461 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
1462 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1463 Returns the GET or the POST parameter with name
1464 <code><i>name</i></code> (a string) - or <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>
1465 if there is none. If both a GET and a POST parameter with
1466 the same name exist the GET parameter is returned. Search
1467 is case-sensitive. See also
1468 <code><a href="#get-parameter">GET-PARAMETER</a></code> and
1469 <code><a href="#post-parameter">POST-PARAMETER</a></code>.
1470 </clix:description></blockquote></p>
1472 <p xmlns=""><a class="none" name="get-parameter"></a>
1473 [Function]
1474 <br><b>get-parameter</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name <tt>&amp;optional</tt> request</clix:lambda-list></i>
1475 =&gt;
1476 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1477 Returns the value of the GET parameter (as provided via the
1478 request URI) named by the string <code><i>name</i></code> as a
1479 string (or <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> if there ain't no GET parameter
1480 with this name). Note that only the first value will be
1481 returned if the client provided more than one GET parameter
1482 with the name <code><i>name</i></code>. See
1483 also <code><a href="#get-parameters*">GET-PARAMETERS*</a></code>.
1484 </clix:description></blockquote></p>
1486 <p xmlns=""><a class="none" name="post-parameter"></a>
1487 [Function]
1488 <br><b>post-parameter</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name <tt>&amp;optional</tt> request</clix:lambda-list></i>
1489 =&gt;
1490 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1491 Returns the value of the POST parameter (as provided in the
1492 request's body) named by the
1493 string <code><i>name</i></code>. Note that only the first value
1494 will be returned if the client provided more than one POST
1495 parameter with the name <code><i>name</i></code>. This value
1496 will usually be a string (or <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> if there ain't
1497 no POST parameter with this name). If, however, the browser
1498 sent a <a xmlns="http://www.w3.org/1999/xhtml" class="none" name="upload">file</a> through
1499 a <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.faqs.org/rfcs/rfc2388.html">
1500 <code>multipart/form-data</code>
1501 </a> form, the value of this function is a three-element list
1502 <pre xmlns="http://www.w3.org/1999/xhtml">(path file-name content-type)</pre>
1503 where <code><i>path</i></code> is a pathname denoting the place
1504 were the uploaded file was
1505 stored, <code><i>file-name</i></code> (a string) is the file
1506 name sent by the browser, and <code><i>content-type</i></code>
1507 (also a string) is the content type sent by the browser. The
1508 file denoted by <code><i>path</i></code> will be deleted after
1509 the request has been handled - you have to move or copy it
1510 somewhere else if you want to keep it.
1511 <p xmlns="http://www.w3.org/1999/xhtml">
1512 POST parameters will only be computed if the content type of
1513 the request body was <code>multipart/form-data</code>
1514 or <code>application/x-www-form-urlencoded</code>. Although
1515 this function is called <code>POST-PARAMETER</code>, you can
1516 instruct Hunchentoot to compute these parameters for other
1517 request methods by
1518 setting <code xmlns=""><a href="#*methods-for-post-parameters*">*METHODS-FOR-POST-PARAMETERS*</a></code>.
1519 </p>
1520 <p xmlns="http://www.w3.org/1999/xhtml">
1521 See also <code xmlns=""><a href="#post-parameters">POST-PARAMETERS</a></code>
1522 and <code xmlns=""><a href="#*tmp-directory*">*TMP-DIRECTORY*</a></code>.
1523 </p>
1524 </clix:description></blockquote></p>
1526 <p xmlns=""><a class="none" name="get-parameters*"></a>
1527 [Function]
1528 <br><b>get-parameters*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc"><tt>&amp;optional</tt> request</clix:lambda-list></i>
1529 =&gt;
1530 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">alist</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1531 Returns
1532 an <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#alist">alist</a>
1533 of all GET parameters (as provided via the request
1534 URI). The <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#car">car</a>
1535 of each element of this list is the parameter's name while
1536 the <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#cdr">cdr</a>
1537 is its value (as a string). The elements of this list are in
1538 the same order as they were within the request URI. See
1539 also <code><a href="#get-parameter">GET-PARAMETER</a></code>.
1540 </clix:description></blockquote></p>
1542 <p xmlns=""><a class="none" name="post-parameters*"></a>
1543 [Function]
1544 <br><b>post-parameters*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc"><tt>&amp;optional</tt> request</clix:lambda-list></i>
1545 =&gt;
1546 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">alist</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1547 Returns
1548 an <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#alist">alist</a>
1549 of all POST parameters (as provided via the request's
1550 body). The <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#car">car</a>
1551 of each element of this list is the parameter's name while
1552 the <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#cdr">cdr</a>
1553 is its value. The elements of this list are in the same order
1554 as they were within the request's body.
1555 <p xmlns="http://www.w3.org/1999/xhtml">
1556 See also <code xmlns=""><a href="#post-parameter">POST-PARAMETER</a></code>.
1557 </p>
1558 </clix:description></blockquote></p>
1560 <p xmlns=""><a class="none" name="*methods-for-post-parameters*"></a>
1561 [Special variable]
1562 <br><b>*methods-for-post-parameters*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">A list of the request method types (as keywords) for which
1563 Hunchentoot will try to compute <code><i>post-parameters</i></code>.
1564 </clix:description></blockquote></p>
1566 <p xmlns=""><a class="none" name="cookie-in"></a>
1567 [Function]
1568 <br><b>cookie-in</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name
1569 <tt>&amp;optional
1570 </tt> request
1571 </clix:lambda-list></i>
1572 =&gt;
1573 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
1574 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1575 Returns the cookie with the name <code><i>name</i></code> (a string) as sent by the
1576 browser - or <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> if there is none.
1577 </clix:description></blockquote></p>
1579 <p xmlns=""><a class="none" name="cookies-in*"></a>
1580 [Function]
1581 <br><b>cookies-in*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1582 <tt>&amp;optional
1583 </tt> request
1584 </clix:lambda-list></i>
1585 =&gt;
1586 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">alist
1587 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Returns an alist of all cookies associated with the <code><a href="#request">REQUEST</a></code> object
1588 <code><i>request</i></code>.
1589 </clix:description></blockquote></p>
1591 <p xmlns=""><a class="none" name="host"></a>
1592 [Function]
1593 <br><b>host</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1594 <tt>&amp;optional
1595 </tt> request
1596 </clix:lambda-list></i>
1597 =&gt;
1598 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">host
1599 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Returns the 'Host' incoming http header value.
1600 </clix:description></blockquote></p>
1602 <p xmlns=""><a class="none" name="query-string*"></a>
1603 [Function]
1604 <br><b>query-string*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1605 <tt>&amp;optional
1606 </tt> request
1607 </clix:lambda-list></i>
1608 =&gt;
1609 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
1610 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1611 Returns the query string of the <code><a href="#request">REQUEST</a></code> object <code><i>request</i></code>. That's
1612 the part behind the question mark (i.e. the GET parameters).
1613 </clix:description></blockquote></p>
1615 <p xmlns=""><a class="none" name="referer"></a>
1616 [Function]
1617 <br><b>referer</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1618 <tt>&amp;optional
1619 </tt> request
1620 </clix:lambda-list></i>
1621 =&gt;
1622 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
1623 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1624 Returns the 'Referer' (sic!) http header.
1625 </clix:description></blockquote></p>
1627 <p xmlns=""><a class="none" name="request-method*"></a>
1628 [Function]
1629 <br><b>request-method*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1630 <tt>&amp;optional
1631 </tt> request
1632 </clix:lambda-list></i>
1633 =&gt;
1634 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">keyword
1635 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1636 Returns the request method as a Lisp keyword.
1637 </clix:description></blockquote></p>
1639 <p xmlns=""><a class="none" name="request-uri*"></a>
1640 [Function]
1641 <br><b>request-uri*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1642 <tt>&amp;optional
1643 </tt> request
1644 </clix:lambda-list></i>
1645 =&gt;
1646 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">uri
1647 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1648 Returns the request URI.
1649 </clix:description></blockquote></p>
1651 <p xmlns=""><a class="none" name="server-protocol*"></a>
1652 [Function]
1653 <br><b>server-protocol*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1654 <tt>&amp;optional
1655 </tt> request
1656 </clix:lambda-list></i>
1657 =&gt;
1658 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">keyword
1659 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1660 Returns the request protocol as a Lisp keyword.
1661 </clix:description></blockquote></p>
1663 <p xmlns=""><a class="none" name="user-agent"></a>
1664 [Function]
1665 <br><b>user-agent</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1666 <tt>&amp;optional
1667 </tt> request
1668 </clix:lambda-list></i>
1669 =&gt;
1670 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
1671 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1672 Returns the 'User-Agent' http header.
1673 </clix:description></blockquote></p>
1675 <p xmlns=""><a class="none" name="header-in*"></a>
1676 [Function]
1677 <br><b>header-in*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name
1678 <tt>&amp;optional
1679 </tt> request
1680 </clix:lambda-list></i>
1681 =&gt;
1682 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">header
1683 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1684 Returns the incoming header with name
1685 <code><i>name</i></code>. <code><i>name</i></code> can be
1686 a keyword (recommended) or a string.
1687 </clix:description></blockquote></p>
1689 <p xmlns=""><a class="none" name="headers-in*"></a>
1690 [Function]
1691 <br><b>headers-in*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1692 <tt>&amp;optional
1693 </tt> request
1694 </clix:lambda-list></i>
1695 =&gt;
1696 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">alist
1697 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1698 Returns an alist of the incoming headers associated with the
1699 <code><a href="#request">REQUEST</a></code> object
1700 <code><i>request</i></code>.
1701 </clix:description></blockquote></p>
1703 <p xmlns=""><a class="none" name="remote-addr*"></a>
1704 [Function]
1705 <br><b>remote-addr*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1706 <tt>&amp;optional
1707 </tt> request
1708 </clix:lambda-list></i>
1709 =&gt;
1710 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">address
1711 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1712 Returns the address the current request originated from.
1713 </clix:description></blockquote></p>
1715 <p xmlns=""><a class="none" name="remote-port*"></a>
1716 [Function]
1717 <br><b>remote-port*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1718 <tt>&amp;optional
1719 </tt> request
1720 </clix:lambda-list></i>
1721 =&gt;
1722 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">port
1723 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1724 Returns the port the current request originated from.
1725 </clix:description></blockquote></p>
1727 <p xmlns=""><a class="none" name="local-addr*"></a>
1728 [Function]
1729 <br><b>local-addr*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1730 <tt>&amp;optional
1731 </tt> request
1732 </clix:lambda-list></i>
1733 =&gt;
1734 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">address
1735 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1736 The IP address of the local system that the client connected to.
1737 </clix:description></blockquote></p>
1739 <p xmlns=""><a class="none" name="local-port*"></a>
1740 [Function]
1741 <br><b>local-port*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1742 <tt>&amp;optional
1743 </tt> request
1744 </clix:lambda-list></i>
1745 =&gt;
1746 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">port
1747 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1748 The TCP port number of the local system that the client connected to.
1749 </clix:description></blockquote></p>
1751 <p xmlns=""><a class="none" name="script-name*"></a>
1752 [Function]
1753 <br><b>script-name*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1754 <tt>&amp;optional
1755 </tt> request
1756 </clix:lambda-list></i>
1757 =&gt;
1758 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">script-name
1759 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1760 Returns the file name of the <code><a href="#request">REQUEST</a></code>
1761 object <code><i>request</i></code>. That's the
1762 requested URI without the query string (i.e the GET
1763 parameters).
1764 </clix:description></blockquote></p>
1766 <p xmlns=""><a class="none" name="aux-request-value"></a>
1767 [Accessor]
1768 <br><b>aux-request-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">symbol
1769 <tt>&amp;optional
1770 </tt> request
1771 </clix:lambda-list></i>
1772 =&gt;
1773 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">value, present-p
1774 </clix:returns></i><br><tt>(setf (</tt><b>aux-request-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">symbol
1775 <tt>&amp;optional
1776 </tt> request
1777 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1778 This accessor can be used to associate arbitrary
1779 data with the the symbol <code><i>symbol</i></code> in the <code><a href="#request">REQUEST</a></code> object
1780 <code><i>request</i></code>. <code><i>present-p</i></code> is true if such data was found, otherwise <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>.
1781 </clix:description></blockquote></p>
1783 <p xmlns=""><a class="none" name="delete-aux-request-value"></a>
1784 [Function]
1785 <br><b>delete-aux-request-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">symbol
1786 <tt>&amp;optional
1787 </tt> request
1788 </clix:lambda-list></i>
1789 =&gt;
1790 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
1791 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1792 Removes the value associated with <code><i>symbol</i></code> from the <code><a href="#request">REQUEST</a></code> object
1793 <code><i>request</i></code>.
1794 </clix:description></blockquote></p>
1796 <p xmlns=""><a class="none" name="authorization"></a>
1797 [Function]
1798 <br><b>authorization</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1799 <tt>&amp;optional
1800 </tt> request
1801 </clix:lambda-list></i>
1802 =&gt;
1803 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
1804 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1805 Returns as two values the user and password (if any) as
1806 encoded in the 'AUTHORIZATION' header. Returns
1807 <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> if there is no such header.
1808 </clix:description></blockquote></p>
1810 <p xmlns=""><a class="none" name="*hunchentoot-default-external-format*"></a>
1811 [Special variable]
1812 <br><b>*hunchentoot-default-external-format*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1813 The external format used to compute the <code><a href="#request">REQUEST</a></code> object.
1814 </clix:description></blockquote></p>
1816 <p xmlns=""><a class="none" name="*file-upload-hook*"></a>
1817 [Special variable]
1818 <br><b>*file-upload-hook*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1819 If this is not <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>, it should be a unary
1820 function which will be called with a pathname for each file
1821 which is <a xmlns="http://www.w3.org/1999/xhtml" href="#upload">uploaded</a> to Hunchentoot. The
1822 pathname denotes the temporary file to which the uploaded
1823 file is written. The hook is called directly before the
1824 file is created. At this point,
1825 <code><a href="#*request*">*REQUEST*</a></code> is already bound to the
1826 current <code><a href="#request">REQUEST</a></code> object, but obviously
1827 you can't access the post parameters yet.
1828 </clix:description></blockquote></p>
1830 <p xmlns=""><a class="none" name="raw-post-data"></a>
1831 [Function]
1832 <br><b>raw-post-data</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1833 <tt>&amp;key</tt>
1834 request external-format force-text force-binary want-stream
1835 </clix:lambda-list></i>
1836 =&gt;
1837 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">raw-body-or-stream</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1838 Returns the content sent by the client in the request body if
1839 there was any (unless the content type
1840 was <code xmlns="http://www.w3.org/1999/xhtml">multipart/form-data</code> in which
1841 case <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> is returned). By default, the result is
1842 a string if the type of the <code xmlns="http://www.w3.org/1999/xhtml">Content-Type</code>
1843 <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.faqs.org/rfcs/rfc1590.html">media type</a>
1844 is <code xmlns="http://www.w3.org/1999/xhtml">"text"</code>, and a vector of octets otherwise. In
1845 the case of a string, the external format to be used to decode
1846 the content will be determined from the <code xmlns="http://www.w3.org/1999/xhtml">charset</code>
1847 parameter sent by the client (or
1848 otherwise <code><a href="#*hunchentoot-default-external-format*">*HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT*</a></code>
1849 will be used).
1850 <p xmlns="http://www.w3.org/1999/xhtml">
1851 You can also provide an external format explicitly (through
1852 <code xmlns=""><i>external-format</i></code>) in which case the result
1853 will unconditionally be a string. Likewise, you can provide
1854 a true value for <code xmlns=""><i>force-text</i></code> which will
1855 force Hunchentoot to act as if the type of the media type
1856 had been <code>"text"</code>
1857 (with <code xmlns=""><i>external-format</i></code> taking precedence
1858 if provided). Or you can provide a true value
1859 for <code xmlns=""><i>force-binary</i></code> which means that you
1860 want a vector of octets at any rate. (If both
1861 <code xmlns=""><i>force-text</i></code>
1862 and <code xmlns=""><i>force-binary</i></code> are true, an error will
1863 be signaled.)
1864 </p>
1865 <p xmlns="http://www.w3.org/1999/xhtml">
1866 If, however, you provide a true value
1867 for <code xmlns=""><i>want-stream</i></code>, the other parameters are
1868 ignored and you'll get the content (flexi) stream to read
1869 from it yourself. It is then your responsibility to read
1870 the correct amount of data, because otherwise you won't be
1871 able to return a response to the client. The stream will
1872 have
1873 its <a href="http://weitz.de/flexi-streams/#flexi-streams">octet
1874 position</a> set to <code>0</code>. If the client provided
1875 a <code>Content-Length</code> header, the stream will also
1876 have a
1877 corresponding <a href="http://weitz.de/flexi-streams/#flexi-streams">bound</a>,
1878 so no matter whether the client used chunked encoding or
1879 not, you can always read until EOF.
1880 </p>
1881 <p xmlns="http://www.w3.org/1999/xhtml">
1882 If the content type of the request
1883 was <code>multipart/form-data</code>
1884 or <code>application/x-www-form-urlencoded</code>, the
1885 content has been read by Hunchentoot already and you can't
1886 read from the stream anymore.
1887 </p>
1888 <p xmlns="http://www.w3.org/1999/xhtml">
1889 You can call <code xmlns=""><a href="#raw-post-data">RAW-POST-DATA</a></code> more than once
1890 per request, but you can't mix calls which have different
1891 values for <code xmlns=""><i>want-stream</i></code>.
1892 </p>
1893 <p xmlns="http://www.w3.org/1999/xhtml">
1894 Note that this function is slightly misnamed because a
1895 client can send content even if the request method is not
1896 POST.
1897 </p>
1898 </clix:description></blockquote></p>
1901 <p xmlns=""><a class="none" name="recompute-request-parameters"></a>
1902 [Function]
1903 <br><b>recompute-request-parameters</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
1904 <tt>&amp;key
1905 </tt> request external-format
1906 </clix:lambda-list></i>
1907 =&gt;
1908 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
1909 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1910 Recomputes the GET and POST parameters for the <code><a href="#request">REQUEST</a></code> object
1911 <code><i>request</i></code>. This only makes sense if you're switching external formats
1912 during the request.
1913 </clix:description></blockquote></p>
1915 <p xmlns=""><a class="none" name="process-request"></a>
1916 [Generic function]
1917 <br><b>process-request</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
1918 </clix:lambda-list></i>
1919 =&gt;
1920 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">nil
1921 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1922 This function is called by <code><a href="#process-connection">PROCESS-CONNECTION</a></code>
1923 after the incoming headers have been read. It
1924 calls <code><a href="#handle-request">HANDLE-REQUEST</a></code> (and is more or less just a
1925 thin wrapper around it) to select and call a
1926 <a xmlns="http://www.w3.org/1999/xhtml" href="#request-dispatch">handler</a> and send the output of this handler to
1927 the client. Note that <code><a href="#process-connection">PROCESS-CONNECTION</a></code> is
1928 called once per connection and loops in case of a persistent
1929 connection while <code><a href="#process-request">PROCESS-REQUEST</a></code> is called anew
1930 for each request.
1931 <p xmlns="http://www.w3.org/1999/xhtml">
1932 The return value of this function is ignored.
1933 </p>
1934 <p xmlns="http://www.w3.org/1999/xhtml">
1935 Like <code xmlns=""><a href="#process-connection">PROCESS-CONNECTION</a></code>, this is another function
1936 the behaviour of which you should only modify if you really, really
1937 know what you're doing.
1938 </p>
1939 </clix:description></blockquote></p>
1941 <p xmlns=""><a class="none" name="handle-request"></a>
1942 [Generic function]
1943 <br><b>handle-request</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor request
1944 </clix:lambda-list></i>
1945 =&gt;
1946 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">content
1947 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1948 This function is called by <code><a href="#process-request">PROCESS-REQUEST</a></code> once
1949 the request has been read and a <code><a href="#request">REQUEST</a></code> object
1950 has been created. Its job is to actually handle the request, i.e. to
1951 return something to the client.
1952 <p xmlns="http://www.w3.org/1999/xhtml">
1953 The default method calls the
1954 acceptor's <a href="#request-dispatch">request dispatcher</a>, but you
1955 can of course implement a different behaviour. The default method
1956 also sets up <a href="#logging">standard error handling</a> for
1957 the <a href="#request-dispatch">handler</a>.
1958 </p>
1959 <p xmlns="http://www.w3.org/1999/xhtml">
1960 Might be a good place to bind or rebind special variables which can
1961 then be accessed by your <a href="#request-dispatch">handlers</a>.
1962 </p>
1963 </clix:description></blockquote></p>
1965 <p xmlns=""><a class="none" name="acceptor-dispatch-request"></a>
1966 [Generic function]
1967 <br><b>acceptor-dispatch-request</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor request
1968 </clix:lambda-list></i>
1969 =&gt;
1970 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">content
1971 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
1972 This function is called to actually dispatch the request
1973 once the standard logging and error handling has been set
1974 up. <code><a href="#acceptor">ACCEPTOR</a></code> subclasses implement
1975 methods for this function in order to perform their own
1976 request routing. If a method does not want to handle the
1977 request, it is supposed to invoke <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_call_n.htm">CALL-NEXT-METHOD</a>
1978 so that the next <code><a href="#acceptor">ACCEPTOR</a></code> in the
1979 inheritance chain gets a chance to handle the request.
1980 </clix:description></blockquote></p>
1982 <p xmlns="">
1983 [Generic readers]<br><a class="none" name="cookies-in"></a><b>cookies-in</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
1984 </clix:lambda-list></i>
1985 =&gt;
1986 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">cookies
1987 </clix:returns></i><br><a class="none" name="get-parameters"></a><b>get-parameters</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
1988 </clix:lambda-list></i>
1989 =&gt;
1990 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">get-parameters
1991 </clix:returns></i><br><a class="none" name="header-in"></a><b>header-in</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name request
1992 </clix:lambda-list></i>
1993 =&gt;
1994 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
1995 </clix:returns></i><br><a class="none" name="headers-in"></a><b>headers-in</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
1996 </clix:lambda-list></i>
1997 =&gt;
1998 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">headers
1999 </clix:returns></i><br><a class="none" name="post-parameters"></a><b>post-parameters</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2000 </clix:lambda-list></i>
2001 =&gt;
2002 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">post-parameters
2003 </clix:returns></i><br><a class="none" name="query-string"></a><b>query-string</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2004 </clix:lambda-list></i>
2005 =&gt;
2006 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">query-string
2007 </clix:returns></i><br><a class="none" name="remote-addr"></a><b>remote-addr</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2008 </clix:lambda-list></i>
2009 =&gt;
2010 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">address
2011 </clix:returns></i><br><a class="none" name="remote-port"></a><b>remote-port</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2012 </clix:lambda-list></i>
2013 =&gt;
2014 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">port
2015 </clix:returns></i><br><a class="none" name="local-addr"></a><b>local-addr</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2016 </clix:lambda-list></i>
2017 =&gt;
2018 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">address
2019 </clix:returns></i><br><a class="none" name="local-port"></a><b>local-port</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2020 </clix:lambda-list></i>
2021 =&gt;
2022 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">port
2023 </clix:returns></i><br><a class="none" name="request-acceptor"></a><b>request-acceptor</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2024 </clix:lambda-list></i>
2025 =&gt;
2026 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">acceptor
2027 </clix:returns></i><br><a class="none" name="request-method"></a><b>request-method</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2028 </clix:lambda-list></i>
2029 =&gt;
2030 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">method
2031 </clix:returns></i><br><a class="none" name="request-uri"></a><b>request-uri</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2032 </clix:lambda-list></i>
2033 =&gt;
2034 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">uri
2035 </clix:returns></i><br><a class="none" name="server-protocol"></a><b>server-protocol</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2036 </clix:lambda-list></i>
2037 =&gt;
2038 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">protocol
2039 </clix:returns></i><br><a class="none" name="script-name"></a><b>script-name</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2040 </clix:lambda-list></i>
2041 =&gt;
2042 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
2043 </clix:returns></i><br><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2044 These are various generic readers which are used
2045 to read information about a <code><a href="#request">REQUEST</a></code> object. If you are writing a
2046 <a xmlns="http://www.w3.org/1999/xhtml" href="#request-dispatch">handler</a>, you should <em xmlns="http://www.w3.org/1999/xhtml">not</em> use these readers but instead utilize the
2047 corresponding functions with an asterisk at the end of their name,
2048 also listed in this section. These generic readers are only
2049 exported for users who want to create their own subclasses of
2050 <code><a href="#request">REQUEST</a></code>.
2051 </clix:description></blockquote></p>
2055 <h4 xmlns=""><a name="replies">Reply objects</a></h4>
2057 For each incoming request, the <a href="#acceptors">acceptor</a>
2058 (in <code xmlns=""><a href="#process-connection">PROCESS-CONNECTION</a></code>) creates
2059 a <code xmlns=""><a href="#reply">REPLY</a></code> object and makes it available
2060 to <a href="#request-dispatch">handlers</a> via the special variable
2061 <code xmlns=""><a href="#*reply*">*REPLY*</a></code>. This object contains all relevant
2062 information (except for the content body) about the reply that will be
2063 sent to the client and this section collects the functions which can
2064 be used to query and modify such an object. In all function
2065 where <code xmlns=""><i>reply</i></code> is an optional or keyword parameter,
2066 the default is <code xmlns=""><a href="#*reply*">*REPLY*</a></code>.
2069 If you need more fine-grained control over the behaviour of reply
2070 objects, you can subclass <code xmlns=""><a href="#reply">REPLY</a></code> and initialize
2071 the <a href="#acceptor-reply-class"><code>REPLY-CLASS</code></a>
2072 slot of the <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> class accordingly. The
2073 acceptor will generate reply objects of the class named by this
2074 slot.
2075 </p>
2077 <p xmlns=""><a class="none" name="reply"></a>
2078 [Standard class]
2079 <br><b>reply</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2080 Objects of this class hold all the information about an
2081 outgoing reply. They are created automatically by
2082 Hunchentoot and can be accessed and modified by the
2083 corresponding <a xmlns="http://www.w3.org/1999/xhtml" href="#request-dispatch">handler</a>.
2084 <p xmlns="http://www.w3.org/1999/xhtml">
2085 You should not mess with the slots of these objects directly, but you
2086 can subclass <code xmlns=""><a href="#reply">REPLY</a></code> in order to implement your own behaviour. See the
2087 <a href="#acceptor-reply-class"><code>:reply-class</code></a> initarg
2088 of the <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> class.
2089 </p>
2090 </clix:description></blockquote></p>
2092 <p xmlns=""><a class="none" name="*reply*"></a>
2093 [Special variable]
2094 <br><b>*reply*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2095 The current <code><a href="#reply">REPLY</a></code> object in the context of a request.
2096 </clix:description></blockquote></p>
2098 <p xmlns=""><a class="none" name="header-out"></a>
2099 [Accessor]
2100 <br><b>header-out</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name
2101 <tt>&amp;optional
2102 </tt> reply
2103 </clix:lambda-list></i>
2104 =&gt;
2105 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
2106 </clix:returns></i><br><tt>(setf (</tt><b>header-out</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name
2107 <tt>&amp;optional
2108 </tt> reply
2109 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2110 <code><a href="#header-out">HEADER-OUT</a></code> returns the outgoing http
2111 header named by the keyword <code><i>name</i></code> if
2112 there is one, otherwise <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>. <code xmlns="http://www.w3.org/1999/xhtml">SETF</code>
2113 of <code><a href="#header-out">HEADER-OUT</a></code> changes the current value
2114 of the header named <code><i>name</i></code>. If no header
2115 named <code><i>name</i></code> exists, it is created. For
2116 backwards compatibility, <code><i>name</i></code> can also
2117 be a string in which case the association between a header
2118 and its name is case-insensitive.
2119 <p xmlns="http://www.w3.org/1999/xhtml">
2120 Note that the header 'Set-Cookie' cannot be queried by
2121 <code xmlns=""><a href="#header-out">HEADER-OUT</a></code> and must not be set by
2122 <code>SETF</code> of <code xmlns=""><a href="#header-out">HEADER-OUT</a></code>. See
2123 also <code xmlns=""><a href="#headers-out*">HEADERS-OUT*</a></code>,
2124 <code xmlns=""><a href="#content-type*">CONTENT-TYPE*</a></code>,
2125 <code xmlns=""><a href="#content-length*">CONTENT-LENGTH*</a></code>,
2126 <code xmlns=""><a href="#cookies-out*">COOKIES-OUT*</a></code>, and
2127 <code xmlns=""><a href="#cookie-out">COOKIE-OUT</a></code>.
2128 </p>
2129 </clix:description></blockquote></p>
2131 <p xmlns=""><a class="none" name="headers-out*"></a>
2132 [Function]
2133 <br><b>headers-out*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2134 <tt>&amp;optional
2135 </tt> reply
2136 </clix:lambda-list></i>
2137 =&gt;
2138 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">alist
2139 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Returns an alist of the outgoing headers associated with the
2140 <code><a href="#reply">REPLY</a></code> object <code><i>reply</i></code>. See also <code><a href="#header-out">HEADER-OUT</a></code>.
2141 </clix:description></blockquote></p>
2143 <p xmlns=""><a class="none" name="content-length*"></a>
2144 [Accessor]
2145 <br><b>content-length*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2146 <tt>&amp;optional
2147 </tt> reply
2148 </clix:lambda-list></i>
2149 =&gt;
2150 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">content-length
2151 </clix:returns></i><br><tt>(setf (</tt><b>content-length*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2152 <tt>&amp;optional
2153 </tt> reply
2154 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2155 The outgoing 'Content-Length' http header of <code><i>reply</i></code>.
2156 </clix:description></blockquote></p>
2158 <p xmlns=""><a class="none" name="content-type*"></a>
2159 [Accessor]
2160 <br><b>content-type*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2161 <tt>&amp;optional
2162 </tt> reply
2163 </clix:lambda-list></i>
2164 =&gt;
2165 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">content-type
2166 </clix:returns></i><br><tt>(setf (</tt><b>content-type*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2167 <tt>&amp;optional
2168 </tt> reply
2169 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2170 The outgoing 'Content-Type' http header of <code><i>reply</i></code>.
2171 </clix:description></blockquote></p>
2173 <p xmlns=""><a class="none" name="cookie-out"></a>
2174 [Function]
2175 <br><b>cookie-out</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">name
2176 <tt>&amp;optional
2177 </tt> reply
2178 </clix:lambda-list></i>
2179 =&gt;
2180 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
2181 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2182 Returns the current value of the outgoing <a xmlns="http://www.w3.org/1999/xhtml" href="#cookies">cookie</a> named
2183 <code><i>name</i></code>. Search is case-sensitive.
2184 </clix:description></blockquote></p>
2186 <p xmlns=""><a class="none" name="cookies-out*"></a>
2187 [Accessor]
2188 <br><b>cookies-out*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2189 <tt>&amp;optional
2190 </tt> reply
2191 </clix:lambda-list></i>
2192 =&gt;
2193 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">alist
2194 </clix:returns></i><br><tt>(setf (</tt><b>cookies-out*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2195 <tt>&amp;optional
2196 </tt> reply
2197 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2198 Returns or sets an alist of the outgoing <a xmlns="http://www.w3.org/1999/xhtml" href="#cookies">cookies</a> associated with the
2199 <code><a href="#reply">REPLY</a></code> object
2200 <code><i>reply</i></code>.
2201 </clix:description></blockquote></p>
2203 <p xmlns=""><a class="none" name="return-code*"></a>
2204 [Accessor]
2205 <br><b>return-code*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2206 <tt>&amp;optional
2207 </tt> reply
2208 </clix:lambda-list></i>
2209 =&gt;
2210 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">return-code
2211 </clix:returns></i><br><tt>(setf (</tt><b>return-code*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2212 <tt>&amp;optional
2213 </tt> reply
2214 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2215 Gets or sets the http return code of
2216 <code><i>reply</i></code>. The return code of each
2217 <code><a href="#reply">REPLY</a></code> object is initially set to
2218 <code><a href="#+http-ok+">+HTTP-OK+</a></code>.
2219 </clix:description></blockquote></p>
2221 <p xmlns=""><a class="none" name="send-headers"></a>
2222 [Function]
2223 <br><b>send-headers</b> <i></i>
2224 =&gt;
2225 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">stream</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2226 Sends the initial status line and all headers as determined
2227 by the <code><a href="#reply">REPLY</a></code>
2228 object <code><a href="#*reply*">*REPLY*</a></code>. Returns
2229 a <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_b.htm#binary">binary</a>
2230 stream to which the body of the reply can be written. Once
2231 this function has been called, further changes
2232 to <code><a href="#*reply*">*REPLY*</a></code> don't have any effect.
2233 Also, automatic handling of errors (i.e. sending the
2234 corresponding status code to the browser, etc.) is turned
2235 off for this request and functions
2236 like <code><a href="#redirect">REDIRECT</a></code> or
2237 to <code><a href="#abort-request-handler">ABORT-REQUEST-HANDLER</a></code> won't have the
2238 desired effect once the headers are sent.
2239 <p xmlns="http://www.w3.org/1999/xhtml">
2240 If your handlers return the full body as a string or as an
2241 array of octets, you should <em>not</em> call this function.
2242 If a handler calls <code xmlns=""><a href="#send-headers">SEND-HEADERS</a></code> , its
2243 return value is ignored.
2244 </p>
2245 </clix:description></blockquote></p>
2247 <p xmlns=""><a class="none" name="reply-external-format*"></a>
2248 [Accessor]
2249 <br><b>reply-external-format*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2250 <tt>&amp;optional
2251 </tt> reply
2252 </clix:lambda-list></i>
2253 =&gt;
2254 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">external-format
2255 </clix:returns></i><br><tt>(setf (</tt><b>reply-external-format*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2256 <tt>&amp;optional
2257 </tt> reply
2258 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2259 Gets or sets the external format of <code><i>reply</i></code> which is used for character output.
2260 </clix:description></blockquote></p>
2262 <p xmlns=""><a class="none" name="*default-content-type*"></a>
2263 [Special variable]
2264 <br><b>*default-content-type*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2265 The default content-type header which is returned to the client.
2266 </clix:description></blockquote></p>
2268 <p xmlns="">
2269 [Constants]<br><b>+http-continue+</b><br><b>+http-switching-protocols+</b><br><b>+http-ok+</b><br><b>+http-created+</b><br><b>+http-accepted+</b><br><b>+http-non-authoritative-information+</b><br><b>+http-no-content+</b><br><b>+http-reset-content+</b><br><b>+http-partial-content+</b><br><b>+http-multi-status+</b><br><b>+http-multiple-choices+</b><br><b>+http-moved-permanently+</b><br><b>+http-moved-temporarily+</b><br><b>+http-see-other+</b><br><b>+http-not-modified+</b><br><b>+http-use-proxy+</b><br><b>+http-temporary-redirect+</b><br><b>+http-bad-request+</b><br><b>+http-authorization-required+</b><br><b>+http-payment-required+</b><br><b>+http-forbidden+</b><br><b>+http-not-found+</b><br><b>+http-method-not-allowed+</b><br><b>+http-not-acceptable+</b><br><b>+http-proxy-authentication-required+</b><br><b>+http-request-time-out+</b><br><b>+http-conflict+</b><br><b>+http-gone+</b><br><b>+http-length-required+</b><br><b>+http-precondition-failed+</b><br><b>+http-request-entity-too-large+</b><br><b>+http-request-uri-too-large+</b><br><b>+http-unsupported-media-type+</b><br><b>+http-requested-range-not-satisfiable+</b><br><b>+http-expectation-failed+</b><br><b>+http-failed-dependency+</b><br><b>+http-internal-server-error+</b><br><b>+http-not-implemented+</b><br><b>+http-bad-gateway+</b><br><b>+http-service-unavailable+</b><br><b>+http-gateway-time-out+</b><br><b>+http-version-not-supported+</b><br><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2270 The values of these constants are 100, 101, 200, 201, 202,
2271 203, 204, 205, 206, 207, 300, 301, 302, 303, 304, 305, 307,
2272 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411,
2273 412, 413, 414, 415, 416, 417, 424, 500, 501, 502, 503, 504,
2274 and 505. See <code><a href="#return-code">RETURN-CODE</a></code>.
2275 </clix:description></blockquote></p>
2277 <p xmlns="">
2278 [Generic readers]<br><a class="none" name="content-length"></a><b>content-length</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2279 </clix:lambda-list></i>
2280 =&gt;
2281 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">content-length
2282 </clix:returns></i><br><a class="none" name="content-type"></a><b>content-type</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2283 </clix:lambda-list></i>
2284 =&gt;
2285 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">content-type
2286 </clix:returns></i><br><a class="none" name="headers-out"></a><b>headers-out</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2287 </clix:lambda-list></i>
2288 =&gt;
2289 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">headers-out
2290 </clix:returns></i><br><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2291 These are various generic readers which are used
2292 to read information about a <code><a href="#reply">REPLY</a></code> object. If you are writing a
2293 <a xmlns="http://www.w3.org/1999/xhtml" href="#request-dispatch">handler</a>, you should <em xmlns="http://www.w3.org/1999/xhtml">not</em> use these readers but instead utilize the
2294 corresponding functions with an asterisk at the end of their name,
2295 also listed in this section. These generic readers are only
2296 exported for users who want to create their own subclasses of
2297 <code><a href="#reply">REPLY</a></code>.
2298 </clix:description></blockquote></p>
2300 <p xmlns="">
2301 [Generic accessors]<br><a class="none" name="cookies-out"></a><b>cookies-out</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2302 </clix:lambda-list></i>
2303 =&gt;
2304 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
2305 </clix:returns></i><br><tt>(setf (</tt><b>cookies-out</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2306 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="return-code"></a><b>return-code</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2307 </clix:lambda-list></i>
2308 =&gt;
2309 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
2310 </clix:returns></i><br><tt>(setf (</tt><b>return-code</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2311 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><a class="none" name="reply-external-format"></a><b>reply-external-format</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2312 </clix:lambda-list></i>
2313 =&gt;
2314 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
2315 </clix:returns></i><br><tt>(setf (</tt><b>reply-external-format</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">reply
2316 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><br><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2317 These are various generic accessors which are
2318 used to query and modify a <code><a href="#reply">REPLY</a></code> objects. If
2319 you are writing a
2320 <a xmlns="http://www.w3.org/1999/xhtml" href="#request-dispatch">handler</a>, you should <em xmlns="http://www.w3.org/1999/xhtml">not</em> use these
2321 accessors but instead utilize the corresponding functions with an
2322 asterisk at the end of their name, also listed in this section.
2323 These generic accessors are only exported for users who want to
2324 create their own subclasses of
2325 <code><a href="#reply">REPLY</a></code>.
2326 </clix:description></blockquote></p>
2331 <h4 xmlns=""><a name="sessions">Sessions</a></h4>
2332 Hunchentoot supports <em>sessions</em>: Once a <a href="#request-dispatch">request
2333 handler</a> has called <code xmlns=""><a href="#start-session">START-SESSION</a></code>, Hunchentoot
2334 uses either cookies or (if the client doesn't send the cookies
2335 back) <a href="#*rewrite-for-session-urls*">rewrites URLs</a> to keep
2336 track of this client, i.e. to provide a kind of 'state' for the
2337 stateless http protocol. The session associated with the client is a
2338 <a href="#session">CLOS object</a> which can be used
2339 to <a href="#session-value">store arbitrary data</a> between requests.
2341 Hunchentoot makes some reasonable effort to prevent eavesdroppers from
2342 hijacking sessions (see below), but this should not be considered
2343 really secure. Don't store sensitive data in sessions and rely solely
2344 on the session mechanism as a safeguard against malicious users who
2345 want to get at this data!
2346 </p>
2348 For each request there's one <code xmlns=""><a href="#session">SESSION</a></code> object which is accessible to the
2349 <a href="#handler">handler</a> via the special
2350 variable <code xmlns=""><a href="#*session*">*SESSION*</a></code>. This object holds all the
2351 information available about the session and can be accessed with the
2352 functions described in this chapter. Note that the internal structure
2353 of <code xmlns=""><a href="#session">SESSION</a></code> objects should be considered opaque
2354 and may change in future releases of Hunchentoot.
2355 </p>
2357 Sessions are automatically <a href="#session-verify">verified</a> for
2358 validity and age when the <code xmlns=""><a href="#request">REQUEST</a></code> object is
2359 instantiated, i.e. if <code xmlns=""><a href="#*session*">*SESSION*</a></code> is not NIL then
2360 this session is valid (as far as Hunchentoot is concerned) and
2361 not <a href="#session-too-old-p">too old</a>. Old sessions
2362 are <a href="#session-gc">automatically removed</a>.
2363 </p>
2365 <p xmlns=""><a class="none" name="session"></a>
2366 [Standard class]
2367 <br><b>session</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2368 <code><a href="#session">SESSION</a></code> objects are
2369 automatically maintained by Hunchentoot. They should not be created
2370 explicitly with <code xmlns="http://www.w3.org/1999/xhtml">MAKE-INSTANCE</code> but implicitly
2371 with <code><a href="#start-session">START-SESSION</a></code> and they should be treated as
2372 opaque objects.
2373 <p xmlns="http://www.w3.org/1999/xhtml">
2374 You can ignore Hunchentoot's <code xmlns=""><a href="#session">SESSION</a></code> objects and
2375 <a href="#session-behaviour">implement your own sessions</a> if you provide corresponding methods for
2376 <code xmlns=""><a href="#session-cookie-value">SESSION-COOKIE-VALUE</a></code>
2377 and <code xmlns=""><a href="#session-verify">SESSION-VERIFY</a></code>.
2378 </p>
2379 </clix:description></blockquote></p>
2381 <p xmlns=""><a class="none" name="start-session"></a>
2382 [Function]
2383 <br><b>start-session</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2384 </clix:lambda-list></i>
2385 =&gt;
2386 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">session
2387 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2388 Returns the current <code><a href="#session">SESSION</a></code>
2389 object. If there is no current session, creates one and updates the
2390 corresponding data structures. In this case the function will also
2391 send a session cookie to the browser.
2392 </clix:description></blockquote></p>
2394 <p xmlns=""><a class="none" name="session-value"></a>
2395 [Accessor]
2396 <br><b>session-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">symbol
2397 <tt>&amp;optional
2398 </tt> session
2399 </clix:lambda-list></i>
2400 =&gt;
2401 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">value, present-p
2402 </clix:returns></i><br><tt>(setf (</tt><b>session-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">symbol
2403 <tt>&amp;optional
2404 </tt> session
2405 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2406 This accessor can be used to associate arbitrary data with the the
2407 symbol <code><i>symbol</i></code> in the <code><a href="#session">SESSION</a></code>
2408 object <code><i>session</i></code>. <code><i>present-p</i></code> is
2409 true if such data was found, otherwise <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>. The default
2410 value for <code><i>session</i></code> is
2411 <code><a href="#*session*">*SESSION*</a></code>.
2412 <p xmlns="http://www.w3.org/1999/xhtml">
2413 If <code>SETF</code> of <code xmlns=""><a href="#session-value">SESSION-VALUE</a></code> is called
2414 with <code xmlns=""><i>session</i></code> being <code>NIL</code> then a
2415 session is automatically instantiated
2416 with <code xmlns=""><a href="#start-session">START-SESSION</a></code>.
2417 </p>
2418 </clix:description></blockquote></p>
2420 <p xmlns=""><a class="none" name="delete-session-value"></a>
2421 [Function]
2422 <br><b>delete-session-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">symbol
2423 <tt>&amp;optional
2424 </tt> session
2425 </clix:lambda-list></i>
2426 =&gt;
2427 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
2428 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2429 Removes the value associated with
2430 <code><i>symbol</i></code> from
2431 <code><i>session</i></code> if there is one.
2432 </clix:description></blockquote></p>
2434 <p xmlns=""><a class="none" name="*session*"></a>
2435 [Special variable]
2436 <br><b>*session*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2437 The current session while in the context of a request, or
2438 <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>.
2439 </clix:description></blockquote></p>
2441 <p xmlns=""><a class="none" name="remove-session"></a>
2442 [Function]
2443 <br><b>remove-session</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2444 </clix:lambda-list></i>
2445 =&gt;
2446 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
2447 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2448 Completely removes the <code><a href="#session">SESSION</a></code> object
2449 <code><i>session</i></code> from Hunchentoot's
2450 internal <a xmlns="http://www.w3.org/1999/xhtml" href="#session-db">session database</a>.
2451 </clix:description></blockquote></p>
2453 <p xmlns=""><a class="none" name="reset-sessions"></a>
2454 [Function]
2455 <br><b>reset-sessions</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2456 <tt>&amp;optional
2457 </tt> acceptor
2458 </clix:lambda-list></i>
2459 =&gt;
2460 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
2461 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2462 Removes <em xmlns="http://www.w3.org/1999/xhtml">all</em> stored sessions of
2463 <code><i>acceptor</i></code>. The default for
2464 <code><i>acceptor</i></code> is
2465 <code><a href="#*acceptor*">*ACCEPTOR*</a></code>.
2466 </clix:description></blockquote></p>
2468 <p xmlns=""><a class="none" name="*rewrite-for-session-urls*"></a>
2469 [Special variable]
2470 <br><b>*rewrite-for-session-urls*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2471 Whether HTML pages should possibly be rewritten for cookie-less
2472 session-management.
2473 </clix:description></blockquote></p>
2475 <p xmlns=""><a class="none" name="*content-types-for-url-rewrite*"></a>
2476 [Special variable]
2477 <br><b>*content-types-for-url-rewrite*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2478 The content types for which url-rewriting is OK. See
2479 <code><a href="#*rewrite-for-session-urls*">*REWRITE-FOR-SESSION-URLS*</a></code>.
2480 </clix:description></blockquote></p>
2482 <p xmlns=""><a class="none" name="*use-remote-addr-for-sessions*"></a>
2483 [Special variable]
2484 <br><b>*use-remote-addr-for-sessions*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2485 Whether the client's remote IP (as returned by <code><a href="#real-remote-addr">REAL-REMOTE-ADDR</a></code>)
2486 should be encoded into the session string. If this value is true, a
2487 session will cease to be accessible if the client's remote IP changes.
2488 <p xmlns="http://www.w3.org/1999/xhtml">
2489 This might for example be an issue if the client uses a proxy server
2490 which doesn't send correct 'X-Forwarded-For' headers.
2491 </p>
2492 </clix:description></blockquote></p>
2494 <p xmlns=""><a class="none" name="session-remote-addr"></a>
2495 [Generic function]
2496 <br><b>session-remote-addr</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2497 </clix:lambda-list></i>
2498 =&gt;
2499 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">remote-addr
2500 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2501 The remote IP address of the client when this session was started (as
2502 returned by <code><a href="#real-remote-addr">REAL-REMOTE-ADDR</a></code>).
2503 </clix:description></blockquote></p>
2505 <p xmlns=""><a class="none" name="*use-user-agent-for-sessions*"></a>
2506 [Special variable]
2507 <br><b>*use-user-agent-for-sessions*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">Whether the 'User-Agent' header should
2508 be encoded into the session string. If this value is true, a session
2509 will cease to be accessible if the client sends a different
2510 'User-Agent' header.
2511 </clix:description></blockquote></p>
2513 <p xmlns=""><a class="none" name="session-user-agent"></a>
2514 [Generic function]
2515 <br><b>session-user-agent</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2516 </clix:lambda-list></i>
2517 =&gt;
2518 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">user-agent
2519 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2520 The incoming 'User-Agent' header that
2521 was sent when this session was created.
2522 </clix:description></blockquote></p>
2524 <p xmlns=""><a class="none" name="session-max-time"></a>
2525 [Generic accessor]
2526 <br><b>session-max-time</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2527 </clix:lambda-list></i>
2528 =&gt;
2529 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">max-time
2530 </clix:returns></i><br><tt>(setf (</tt><b>session-max-time</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2531 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2532 Gets or sets the time (in seconds) after
2533 which <code><i>session</i></code> expires if it's not used.
2534 </clix:description></blockquote></p>
2537 <p xmlns=""><a class="none" name="*session-max-time*"></a>
2538 [Special variable]
2539 <br><b>*session-max-time*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2540 The default time (in seconds) after which a session times out.
2541 </clix:description></blockquote></p>
2543 <p xmlns=""><a class="none" name="*session-gc-frequency*"></a>
2544 [Special variable]
2545 <br><b>*session-gc-frequency*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2546 A session GC (see function <code><a href="#session-gc">SESSION-GC</a></code>) will happen every
2547 <code><a href="#*session-gc-frequency*">*SESSION-GC-FREQUENCY*</a></code> requests (counting only
2548 requests which create a new session) if this variable is
2549 not <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>. See <code><a href="#session-created">SESSION-CREATED</a></code>.
2550 </clix:description></blockquote></p>
2552 <p xmlns=""><a class="none" name="session-gc"></a>
2553 [Function]
2554 <br><b>session-gc</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2555 </clix:lambda-list></i>
2556 =&gt;
2557 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
2558 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2559 Removes sessions from the current session database which are
2560 too old - see <code><a href="#session-too-old-p">SESSION-TOO-OLD-P</a></code>.
2561 </clix:description></blockquote></p>
2563 <p xmlns=""><a class="none" name="session-too-old-p"></a>
2564 [Function]
2565 <br><b>session-too-old-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2566 </clix:lambda-list></i>
2567 =&gt;
2568 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">generalized-boolean
2569 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2570 Returns true if the <code><a href="#session">SESSION</a></code> object <code><i>session</i></code> has not been active in
2571 the last <code xmlns="http://www.w3.org/1999/xhtml">(session-max-time session)</code> seconds.
2572 </clix:description></blockquote></p>
2574 <p xmlns=""><a class="none" name="session-id"></a>
2575 [Generic function]
2576 <br><b>session-id</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2577 </clix:lambda-list></i>
2578 =&gt;
2579 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">session-id
2580 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2581 The unique ID (an INTEGER) of the session.
2582 </clix:description></blockquote></p>
2584 <p xmlns=""><a class="none" name="session-start"></a>
2585 [Generic function]
2586 <br><b>session-start</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2587 </clix:lambda-list></i>
2588 =&gt;
2589 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">universal-time
2590 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2591 The time this session was started.
2592 </clix:description></blockquote></p>
2597 <h4 xmlns=""><a name="session-behaviour">Customizing session behaviour</a></h4>
2599 For everyday session usage, you will probably just
2600 use <code xmlns=""><a href="#start-session">START-SESSION</a></code>,
2601 <code xmlns=""><a href="#session-value">SESSION-VALUE</a></code>,
2602 and maybe <code xmlns=""><a href="#delete-session-value">DELETE-SESSION-VALUE</a></code>
2603 and <code xmlns=""><a href="#*session*">*SESSION*</a></code>. However, there are two ways to
2604 customize the way Hunchentoot maintains sessions.
2606 One way is to mostly leave the session mechanism intact but to tweak
2607 it a bit:
2608 <ul>
2609 <li>The publicly visible part of a session is encoded using a
2610 <a href="#*session-secret*">secret</a> which you can set yourself.</li>
2611 <li>And it is stored using a cookie (or GET
2612 parameter) <a href="#session-cookie-name">name</a> that you can
2613 override.</li>
2614 <li>Each session receives a <a href="#next-session-id">new ID</a> when
2615 it is created and you can implement a more robust way to do that.</li>
2616 <li>You can arrange to be called whenever a session
2617 is <a href="#session-created">created</a> to trigger some action. You
2618 might also do this to invent your own
2619 session <a href="#session-gc">garbage collection</a>.</li>
2620 <li>By default, all sessions are stored in a global alist in memory.
2621 You can't change the alist part, but you can distribute your sessions
2622 over different <a href="#session-db">"databases"</a>.</li>
2623 <li>By default, every operation which modifies sessions or one of the
2624 session databases is guarded by a global lock, but you can arrange to
2625 <a href="#session-db-lock">provide</a> different locks for this.</li>
2626 </ul>
2627 </p>
2629 The other way to customize Hunchentoot's sessions is to completely
2630 replace them. This is actually pretty easy: Create your own class to
2631 store state (which doesn't have to and probably shouldn't inherit
2632 from <code xmlns=""><a href="#session">SESSION</a></code>) and implement methods for
2633 <code xmlns=""><a href="#session-verify">SESSION-VERIFY</a></code>
2634 and <code xmlns=""><a href="#session-cookie-value">SESSION-COOKIE-VALUE</a></code> - that's it.
2635 Hunchentoot will continue to use cookies and/or to rewrite URLs to
2636 keep track of session state and it will store "the current session"
2637 (whatever that is in your implementation)
2638 in <code xmlns=""><a href="#*session*">*SESSION*</a></code>. Everything else (like persisting
2639 sessions, GC, getting and setting values) you'll have to take care of
2640 yourself and the other session functions
2641 (like <code xmlns=""><a href="#start-session">START-SESSION</a></code> or
2642 <code xmlns=""><a href="#session-value">SESSION-VALUE</a></code>) won't work anymore. (Almost)
2643 total freedom, but a lot of responsibility as well... :)
2644 </p>
2646 <p xmlns=""><a class="none" name="*session-secret*"></a>
2647 [Special variable]
2648 <br><b>*session-secret*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2649 A random ASCII string that's used to encode the public
2650 session data. This variable is initially unbound and will
2651 be set (using <code><a href="#reset-session-secret">RESET-SESSION-SECRET</a></code>) the
2652 first time a session is created, if necessary. You can
2653 prevent this from happening if you set the value yourself
2654 before starting <a xmlns="http://www.w3.org/1999/xhtml" href="#acceptors">acceptors</a>.
2655 </clix:description></blockquote></p>
2657 <p xmlns=""><a class="none" name="reset-session-secret"></a>
2658 [Function]
2659 <br><b>reset-session-secret</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2660 </clix:lambda-list></i>
2661 =&gt;
2662 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">secret
2663 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2664 Sets <code><a href="#*session-secret*">*SESSION-SECRET*</a></code> to a
2665 new random value. All old sessions will cease to be valid.
2666 </clix:description></blockquote></p>
2668 <p xmlns=""><a class="none" name="session-cookie-name"></a>
2669 [Generic function]
2670 <br><b>session-cookie-name</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
2671 </clix:lambda-list></i>
2672 =&gt;
2673 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">name
2674 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2675 Returns the name (a string) of the cookie (or
2676 the GET parameter) which is used to store a session on the client
2677 side. The default is to use the
2678 string <code xmlns="http://www.w3.org/1999/xhtml">"hunchentoot-session"</code>, but you can
2679 specialize this function if you want another name.
2680 </clix:description></blockquote></p>
2682 <p xmlns=""><a class="none" name="session-created"></a>
2683 [Generic function]
2684 <br><b>session-created</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor new-session
2685 </clix:lambda-list></i>
2686 =&gt;
2687 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
2688 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2689 This function is called whenever a new session
2690 has been created. There's a default method which might trigger
2691 a <a xmlns="http://www.w3.org/1999/xhtml" href="#session-gc">session GC</a> based on the value of
2692 <code><a href="#*session-gc-frequency*">*SESSION-GC-FREQUENCY*</a></code>.
2693 <p xmlns="http://www.w3.org/1999/xhtml">
2694 The return value is ignored.
2695 </p>
2696 </clix:description></blockquote></p>
2698 <p xmlns=""><a class="none" name="next-session-id"></a>
2699 [Generic function]
2700 <br><b>next-session-id</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
2701 </clix:lambda-list></i>
2702 =&gt;
2703 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">id
2704 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2705 Returns the next sequential session ID, an
2706 integer, which should be unique per session. The default method uses
2707 a simple global counter and isn't guarded by a lock. For a
2708 high-performance production environment you might consider using a
2709 more robust implementation.
2710 </clix:description></blockquote></p>
2712 <p xmlns=""><a class="none" name="session-db"></a>
2713 [Generic accessor]
2714 <br><b>session-db</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
2715 </clix:lambda-list></i>
2716 =&gt;
2717 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">database
2718 </clix:returns></i><br><tt>(setf (</tt><b>session-db</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
2719 </clix:lambda-list></i><tt>) <i>new-value</i>)</tt><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2720 Returns the current session database which is an
2721 alist where each car is a session's ID and the cdr is the
2722 corresponding <code><a href="#session">SESSION</a></code> object itself. The default
2723 is to use a global list for all acceptors.
2724 </clix:description></blockquote></p>
2726 <p xmlns=""><a class="none" name="session-db-lock"></a>
2727 [Generic function]
2728 <br><b>session-db-lock</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">acceptor
2729 <tt>&amp;key
2730 </tt> whole-db-p
2731 </clix:lambda-list></i>
2732 =&gt;
2733 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">lock
2734 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2735 A function which returns a lock that will be
2736 used to prevent concurrent access to sessions. The first argument
2737 will be the <a xmlns="http://www.w3.org/1999/xhtml" href="#acceptors">acceptor</a> that handles the
2738 current <a xmlns="http://www.w3.org/1999/xhtml" href="#requests">request</a>, the second argument is true
2739 if the whole (current) session database is modified. If it
2740 is <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>, only one existing session in the database is
2741 modified.
2742 <p xmlns="http://www.w3.org/1999/xhtml">
2743 This function can return <code>NIL</code> which means that sessions or
2744 session databases will be modified without a lock held (for example
2745 for single-threaded environments). The default is to always return a
2746 global lock (ignoring the <code xmlns=""><i>acceptor</i></code> argument) for
2747 Lisps that support threads and <code>NIL</code> otherwise.
2748 </p>
2749 </clix:description></blockquote></p>
2751 <p xmlns=""><a class="none" name="session-verify"></a>
2752 [Generic function]
2753 <br><b>session-verify</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">request
2754 </clix:lambda-list></i>
2755 =&gt;
2756 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">session-or-nil
2757 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2758 Tries to get a session identifier from the cookies
2759 (or alternatively from the GET parameters) sent by the client (see
2760 <code><a href="#session-cookie-name">SESSION-COOKIE-NAME</a></code>
2761 and <code><a href="#session-cookie-value">SESSION-COOKIE-VALUE</a></code>). This identifier is
2762 then checked for validity against the <code><a href="#request">REQUEST</a></code>
2763 object
2764 <code><i>request</i></code>. On success the corresponding session object (if not too
2765 old) is returned (and updated). Otherwise <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> is returned.
2766 <p xmlns="http://www.w3.org/1999/xhtml">
2767 A default method is provided and you only need to write your own one
2768 if you want to maintain your own sessions.
2769 </p>
2770 </clix:description></blockquote></p>
2772 <p xmlns=""><a class="none" name="session-cookie-value"></a>
2773 [Generic function]
2774 <br><b>session-cookie-value</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">session
2775 </clix:lambda-list></i>
2776 =&gt;
2777 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
2778 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2779 Returns a string which can be used to safely
2780 restore the session <code><i>session</i></code> if as session has
2781 already been established. This is used as the value stored in the
2782 session cookie or in the corresponding GET parameter and verified
2783 by <code><a href="#session-verify">SESSION-VERIFY</a></code>.
2784 <p xmlns="http://www.w3.org/1999/xhtml">
2785 A default
2786 method is provided and there's no reason to change it unless you
2787 want to use your own session objects.
2788 </p>
2789 </clix:description></blockquote></p>
2793 <h4 xmlns=""><a name="cookies">Cookies</a></h4>
2795 Outgoing cookies are stored in the request's <code xmlns=""><a href="#reply">REPLY</a></code>
2796 object (see <code xmlns=""><a href="#cookie-out">COOKIE-OUT</a></code>
2797 and <code xmlns=""><a href="#cookies-out*">COOKIES-OUT*</a></code>). They are CLOS objects
2798 defined like this:
2800 <pre>(defclass cookie ()
2801 ((name :initarg :name
2802 :reader <a class="noborder" name="cookie-name">cookie-name</a>
2803 :type string
2804 :documentation "The name of the cookie - a string.")
2805 (value :initarg :value
2806 :accessor <a class="noborder" name="cookie-value">cookie-value</a>
2807 :initform ""
2808 :documentation "The value of the cookie. Will be URL-encoded when sent to the browser.")
2809 (expires :initarg :expires
2810 :initform nil
2811 :accessor <a class="noborder" name="cookie-expires">cookie-expires</a>
2812 :documentation "The time (a universal time) when the cookie expires (or NIL).")
2813 (max-age :initarg :max-age
2814 :initform nil
2815 :accessor <a class="noborder" name="cookie-max-age">cookie-max-age</a>
2816 :documentation "The time delta (in seconds) after which the cookie expires (or NIL).")
2817 (path :initarg :path
2818 :initform nil
2819 :accessor <a class="noborder" name="cookie-path">cookie-path</a>
2820 :documentation "The path this cookie is valid for (or NIL).")
2821 (domain :initarg :domain
2822 :initform nil
2823 :accessor <a class="noborder" name="cookie-domain">cookie-domain</a>
2824 :documentation "The domain this cookie is valid for (or NIL).")
2825 (secure :initarg :secure
2826 :initform nil
2827 :accessor <a class="noborder" name="cookie-secure">cookie-secure</a>
2828 :documentation "A generalized boolean denoting whether this is a secure cookie.")
2829 (http-only :initarg :http-only
2830 :initform nil
2831 :accessor <a class="noborder" name="cookie-http-only">cookie-http-only</a>
2832 :documentation "A generalized boolean denoting whether this is a <a href="http://msdn2.microsoft.com/en-us/library/ms533046.aspx">HttpOnly</a> cookie.")))
2833 </pre>
2835 The <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_r.htm#reader">reader</a>
2836 <code xmlns=""><a href="#cookie-name">COOKIE-NAME</a></code> and
2837 the <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#accessor">accessors</a>
2838 <code xmlns=""><a href="#cookie-value">COOKIE-VALUE</a></code>, <code xmlns=""><a href="#cookie-expires">COOKIE-EXPIRES</a></code>, <code xmlns=""><a href="#cookie-max-age">COOKIE-MAX-AGE</a></code>,
2839 <code xmlns=""><a href="#cookie-path">COOKIE-PATH</a></code>, <code xmlns=""><a href="#cookie-domain">COOKIE-DOMAIN</a></code>, <code xmlns=""><a href="#cookie-secure">COOKIE-SECURE</a></code>,
2840 and <code xmlns=""><a href="#cookie-http-only">COOKIE-HTTP-ONLY</a></code> are all exported from
2841 the <code>HUNCHENTOOT</code> package. For now, the class name itself is <em>not</em> exported.
2843 <p xmlns=""><a class="none" name="set-cookie"></a>
2844 [Function]
2845 <br><b>set-cookie</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
2846 name <tt>&amp;key</tt> value expires path
2847 domain secure http-only reply
2848 </clix:lambda-list></i>
2849 =&gt;
2850 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">cookie</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2851 Creates a <code xmlns="http://www.w3.org/1999/xhtml">COOKIE</code> object from the parameters
2852 provided to this function and adds it to the outgoing cookies
2853 of the <a xmlns="http://www.w3.org/1999/xhtml" href="#replies"><code>REPLY</code> object</a>
2854 <code><i>reply</i></code>. If a cookie with the same name
2855 (case-sensitive) already exists, it is replaced. The default
2856 for <code><i>reply</i></code>
2857 is <code><a href="#*reply*">*REPLY*</a></code>. The default
2858 for <code><i>value</i></code> is the empty string.
2859 </clix:description></blockquote></p>
2861 <p xmlns=""><a class="none" name="set-cookie*"></a>
2862 [Function]
2863 <br><b>set-cookie*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">cookie <tt>&amp;optional</tt> reply</clix:lambda-list></i>
2864 =&gt;
2865 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">cookie</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2866 Adds the <code xmlns="http://www.w3.org/1999/xhtml">COOKIE</code> object <code><i>cookie</i></code>
2867 to the outgoing cookies of
2868 the <a xmlns="http://www.w3.org/1999/xhtml" href="#replies"><code>REPLY</code> object</a>
2869 <code><i>reply</i></code>. If a cookie with the same name
2870 (case-sensitive) already exists, it is replaced. The default
2871 for <code><i>reply</i></code> is <code><a href="#*reply*">*REPLY*</a></code>.
2872 </clix:description></blockquote></p>
2875 <h4 xmlns=""><a name="logging">Logging</a></h4>
2876 Hunchentoot can log accesses and diagnostic messages to two
2877 separate destinations, which can be either files in the file
2878 system or streams. Logging can also be disabled by setting the
2879 <clix:code xmlns:clix="http://bknr.net/clixdoc">ACCESS-LOG-DESTINATION</clix:code> and
2880 <clix:code xmlns:clix="http://bknr.net/clixdoc">MESSAGE-LOG-DESTINATION</clix:code> slots in the
2881 <code xmlns=""><a href="#acceptor">ACCEPTOR</a></code> to <code>NIL</code>. The two
2882 slots can be initialized by providing the
2883 :ACCESS-LOG-DESTINATION and :MESSAGE-LOG-DESTINATION
2884 initialization arguments when creating the acceptor or set by
2885 setting the slots through its
2886 <code xmlns=""><a href="#acceptor-message-log-destination">ACCEPTOR-MESSAGE-LOG-DESTINATION</a></code> and
2887 <code xmlns=""><a href="#acceptor-access-log-destination">ACCEPTOR-ACCESS-LOG-DESTINATION</a></code> accessors.
2889 When the path for the message or accept log is set to a
2890 variable holding an output stream, hunchentoots writes
2891 corresponding log entries to that stream. By default,
2892 Hunchentoot logs to *STANDARD-ERROR*.
2893 </p>
2895 Access logging is done in a format similar to what
2896 the Apache web server can write so that logfile analysis using
2897 standard tools is possible. Errors during request processing are
2898 logged to a separate file.
2899 </p>
2901 The standard logging mechanism is deliberately simple and slow. The
2902 log files are opened for each log entry and closed again after
2903 writing, and access to them is protected by a global lock. Derived
2904 acceptor classes can implement methods for the
2905 <code xmlns=""><a href="#acceptor-log-message">ACCEPTOR-LOG-MESSAGE</a></code> and
2906 <code xmlns=""><a href="#acceptor-log-access">ACCEPTOR-LOG-ACCESS</a></code> generic functions in order to
2907 log differently (e.g. to a central logging server or in a different
2908 file format.
2909 </p>
2911 Errors happening within a <a href="#request-dispatch">handler</a>
2912 which are not caught by the handler itself are handled by
2913 Hunchentoot by logging them to the established
2914 <code xmlns=""><a href="#acceptor-message-log-destination">ACCEPTOR-MESSAGE-LOG-DESTINATION</a></code>.
2915 </p>
2917 <p xmlns=""><a class="none" name="log-message*"></a>
2918 [Function]
2919 <br><b>log-message*</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">log-level format-string
2920 <tt>&amp;rest
2921 </tt> format-arguments
2922 </clix:lambda-list></i>
2923 =&gt;
2924 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
2925 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2926 Convenience function which calls the message
2927 logger of the current acceptor (if there is one) with the same
2928 arguments it accepts. Returns <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> if there is no message
2929 logger or whatever the message logger returns.
2930 <p xmlns="http://www.w3.org/1999/xhtml">
2931 This is the function which Hunchentoot itself uses to log errors it
2932 catches during request processing.
2933 </p>
2934 </clix:description></blockquote></p>
2936 <p xmlns=""><a class="none" name="*log-lisp-errors-p*"></a>
2937 [Special variable]
2938 <br><b>*log-lisp-errors-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2939 Whether Lisp errors in request handlers should be logged.
2940 </clix:description></blockquote></p>
2942 <p xmlns=""><a class="none" name="*log-lisp-backtraces-p*"></a>
2943 [Special variable]
2944 <br><b>*log-lisp-backtraces-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2945 Whether Lisp backtraces should be logged. Only
2946 has an effect if <code><a href="#*log-lisp-errors-p*">*LOG-LISP-ERRORS-P*</a></code> is true
2947 as well.
2948 </clix:description></blockquote></p>
2950 <p xmlns=""><a class="none" name="*log-lisp-warnings-p*"></a>
2951 [Special variable]
2952 <br><b>*log-lisp-warnings-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2953 Whether Lisp warnings in request handlers should be logged.
2954 </clix:description></blockquote></p>
2956 <p xmlns=""><a class="none" name="*lisp-errors-log-level*"></a>
2957 [Special variable]
2958 <br><b>*lisp-errors-log-level*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2959 Log level for Lisp errors. Should be one
2960 of <code xmlns="http://www.w3.org/1999/xhtml">:ERROR</code> (the default), <code xmlns="http://www.w3.org/1999/xhtml">:WARNING</code>,
2961 or <code xmlns="http://www.w3.org/1999/xhtml">:INFO</code>.
2962 </clix:description></blockquote></p>
2964 <p xmlns=""><a class="none" name="*lisp-warnings-log-level*"></a>
2965 [Special variable]
2966 <br><b>*lisp-warnings-log-level*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2967 Log level for Lisp warnings.
2968 Should be one of <code xmlns="http://www.w3.org/1999/xhtml">:ERROR</code>, <code xmlns="http://www.w3.org/1999/xhtml">:WARNING</code>
2969 (the default), or <code xmlns="http://www.w3.org/1999/xhtml">:INFO</code>.
2970 </clix:description></blockquote></p>
2973 <h4 xmlns=""><a name="conditions">Conditions and error handling</a></h4>
2975 This section describes how Hunchentoot deals with exceptional
2976 situations. See also the secion about <a href="#logging">logging</a>.
2977 </p>
2979 When an error occurs while processing a request, Hunchentoot's
2980 default behavior is to catch catch the error, log it and
2981 optionally display it to the client in the HTML response.
2982 This behavior can be customized through the values of a number
2983 of special variables, which are documented below.
2984 </p>
2986 <p xmlns=""><a class="none" name="*catch-errors-p*"></a>
2987 [Special variable]
2988 <br><b>*catch-errors-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
2989 If the value of this variable is <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>
2990 (the default is <code xmlns="http://www.w3.org/1999/xhtml">T</code>), then errors which happen while a
2991 request is handled aren't <a xmlns="http://www.w3.org/1999/xhtml" href="#logging">caught as usual</a>, but
2992 instead your
2993 Lisp's <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_d.htm#debugger">debugger</a>
2994 is <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_invoke.htm">invoked</a>.
2995 This variable should obviously always be set to a <em xmlns="http://www.w3.org/1999/xhtml">true</em> value
2996 in a production environment.
2997 See <code><a href="#maybe-invoke-debugger">MAYBE-INVOKE-DEBUGGER</a></code>
2998 if you want to fine-tune this behaviour.
2999 </clix:description></blockquote></p>
3001 <p xmlns=""><a class="none" name="*show-lisp-errors-p*"></a>
3002 [Special variable]
3003 <br><b>*show-lisp-errors-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3004 Whether Lisp errors should be shown in HTML output. Note
3005 that this only affects canned responses generated by Lisp.
3006 If an error template is present for the "internal server
3007 error" status code, this special variable is not used (see
3008 <code><a href="#acceptor-status-message">acceptor-status-message</a></code>).
3009 </clix:description></blockquote></p>
3011 <p xmlns=""><a class="none" name="*show-lisp-backtraces-p*"></a>
3012 [Special variable]
3013 <br><b>*show-lisp-backtraces-p*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3014 Whether Lisp backtraces should be shown in HTML output if
3015 <code><a href="#*show-lisp-errors-p*">*SHOW-LISP-ERRORS-P*</a></code> is true and an error occurs.
3016 </clix:description></blockquote></p>
3018 <p xmlns=""><a class="none" name="maybe-invoke-debugger"></a>
3019 [Generic function]
3020 <br><b>maybe-invoke-debugger</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">condition
3021 </clix:lambda-list></i>
3022 =&gt;
3023 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
3024 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3025 This generic function is called whenever a
3026 <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/09_.htm">condition</a> <code xmlns="http://www.w3.org/1999/xhtml"><i>condition</i></code>
3027 is signaled in Hunchentoot. You might want to specialize it on
3028 specific condition classes for debugging purposes. The default
3029 method <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_invoke.htm">invokes
3030 the debugger</a> with <code><i>condition</i></code> if
3031 <code><a href="#*catch-errors-p*">*CATCH-ERRORS-P*</a></code> is <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>.
3032 </clix:description></blockquote></p>
3034 <p xmlns=""><a class="none" name="hunchentoot-condition"></a>
3035 [Condition type]
3036 <br><b>hunchentoot-condition</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3037 Superclass for all conditions related to Hunchentoot.
3038 </clix:description></blockquote></p>
3040 <p xmlns=""><a class="none" name="hunchentoot-error"></a>
3041 [Condition type]
3042 <br><b>hunchentoot-error</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3043 Superclass for all errors related to Hunchentoot and a subclass of <code><a href="#hunchentoot-condition">HUNCHENTOOT-CONDITION</a></code>.
3044 </clix:description></blockquote></p>
3046 <p xmlns=""><a class="none" name="parameter-error"></a>
3047 [Condition type]
3048 <br><b>parameter-error</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3049 Signalled if a function was called with incosistent or illegal parameters. A subclass of <code><a href="#hunchentoot-error">HUNCHENTOOT-ERROR</a></code>.
3050 </clix:description></blockquote></p>
3052 <p xmlns=""><a class="none" name="hunchentoot-warning"></a>
3053 [Condition type]
3054 <br><b>hunchentoot-warning</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3055 Superclass for all warnings related to Hunchentoot and a subclass of <code><a href="#hunchentoot-condition">HUNCHENTOOT-CONDITION</a></code>.
3056 </clix:description></blockquote></p>
3060 <h4 xmlns=""><a name="misc">Miscellaneous</a></h4>
3062 Various functions and variables which didn't fit into one of the
3063 other categories.
3065 <p xmlns=""><a class="none" name="abort-request-handler"></a>
3066 [Function]
3067 <br><b>abort-request-handler</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
3068 <tt>&amp;optional
3069 </tt> result
3070 </clix:lambda-list></i>
3071 =&gt;
3072 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
3073 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3074 This function can be called by a request handler
3075 at any time to immediately abort handling the request. This works as
3076 if the handler had returned <code><i>result</i></code>. See the
3077 source code of <code><a href="#redirect">REDIRECT</a></code> for an example.
3078 </clix:description></blockquote></p>
3080 <p xmlns=""><a class="none" name="handle-if-modified-since"></a>
3081 [Function]
3082 <br><b>handle-if-modified-since</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">time <tt>&amp;optional</tt> request</clix:lambda-list></i>
3083 =&gt;
3084 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3085 This function is designed to be used inside
3086 a <a xmlns="http://www.w3.org/1999/xhtml" href="#request-dispatch">handler</a>. If the client has sent an
3087 'If-Modified-Since' header
3088 (see <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.faqs.org/rfcs/rfc2616.html">RFC 2616</a>,
3089 section 14.25) and the time specified matches the universal
3090 time
3091 <code><i>time</i></code> then the
3092 header <code><a href="#+http-not-modified+">+HTTP-NOT-MODIFIED+</a></code> with no content
3093 is immediately returned to the client.
3094 <p xmlns="http://www.w3.org/1999/xhtml">
3095 Note that for this function to be useful you should usually
3096 send 'Last-Modified' headers back to the client. See the
3097 code
3098 of <code xmlns=""><a href="#create-static-file-dispatcher-and-handler">CREATE-STATIC-FILE-DISPATCHER-AND-HANDLER</a></code>
3099 for an example.
3100 </p>
3101 </clix:description></blockquote></p>
3103 <p xmlns=""><a class="none" name="handle-static-file"></a>
3104 [Function]
3105 <br><b>handle-static-file</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">path <tt>&amp;optional</tt> content-type</clix:lambda-list></i>
3106 =&gt;
3107 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">nil</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3108 Sends the file denoted by the pathname designator
3109 <code><i>path</i></code> with content type
3110 <code><i>content-type</i></code> to the client. Sets the
3111 necessary handlers. In particular the function employs
3112 <code><a href="#handle-if-modified-since">HANDLE-IF-MODIFIED-SINCE</a></code>.
3113 <p xmlns="http://www.w3.org/1999/xhtml">
3114 If <code xmlns=""><i>content-type</i></code> is <code>NIL</code> the
3115 function tries to determine the correct content type from
3116 the file's suffix or falls back
3117 to <code>"application/octet-stream"</code> as a last resort.
3118 </p>
3119 <p xmlns="http://www.w3.org/1999/xhtml">
3120 Note that this function
3121 calls <code xmlns=""><a href="#send-headers">SEND-HEADERS</a></code> internally, so after
3122 you've called it, the headers are sent and the return value
3123 of your handler is ignored.
3124 </p>
3125 </clix:description></blockquote></p>
3127 <p xmlns=""><a class="none" name="redirect"></a>
3128 [Function]
3129 <br><b>redirect</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">target <tt>&amp;key</tt> host port protocol add-session-id code</clix:lambda-list></i>
3130 =&gt;
3131 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3132 Sends back appropriate headers to redirect the client
3133 to <code><i>target</i></code> (a string).
3134 <p xmlns="http://www.w3.org/1999/xhtml">
3135 If <code xmlns=""><i>target</i></code> is a full URL starting with a
3136 scheme, <code xmlns=""><i>host</i></code>, <code xmlns=""><i>port</i></code>,
3137 and <code xmlns=""><i>protocol</i></code> are ignored.
3138 Otherwise, <code xmlns=""><i>target</i></code> should denote the path
3139 part of a URL, <code xmlns=""><i>protocol</i></code> must be one of
3140 the keywords <code>:HTTP</code> or <code>:HTTPS</code>, and
3141 the URL to redirect to will be constructed
3142 from <code xmlns=""><i>host</i></code>, <code xmlns=""><i>port</i></code>, <code xmlns=""><i>protocol</i></code>,
3143 and <code xmlns=""><i>target</i></code>.
3144 </p>
3145 <p xmlns="http://www.w3.org/1999/xhtml">
3146 <code xmlns=""><i>code</i></code> must be a 3xx HTTP redirection
3147 status code to send to the client. It defaults to 302
3148 ("Found"). If <code xmlns=""><i>host</i></code> is not provided,
3149 the current host (see <code xmlns=""><a href="#host">HOST</a></code>) will be
3150 used. If <code xmlns=""><i>protocol</i></code> is the keyword
3151 <code>:HTTPS</code>, the client will be redirected to a
3152 https URL, if it's <code>:HTTP</code> it'll be sent to a
3153 http URL. If both <code xmlns=""><i>host</i></code> and
3154 <code xmlns=""><i>protocol</i></code> aren't provided, then the
3155 value of <code xmlns=""><i>protocol</i></code> will match the
3156 current request.
3157 </p>
3158 </clix:description></blockquote></p>
3160 <p xmlns=""><a class="none" name="require-authorization"></a>
3161 [Function]
3162 <br><b>require-authorization</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc"><tt>&amp;optional</tt> realm</clix:lambda-list></i>
3163 =&gt;
3164 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3165 Sends back appropriate headers to require basic HTTP
3166 authentication
3167 (see <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.faqs.org/rfcs/rfc2617.html">RFC 2617</a>)
3168 for the realm <code><i>realm</i></code>. The default value
3169 for <code><i>realm</i></code> is <code xmlns="http://www.w3.org/1999/xhtml">"Hunchentoot"</code>.
3170 </clix:description></blockquote></p>
3172 <p xmlns=""><a class="none" name="no-cache"></a>
3173 [Function]
3174 <br><b>no-cache</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
3175 </clix:lambda-list></i>
3176 =&gt;
3177 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|
3178 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3179 Adds appropriate headers to completely prevent caching on most browsers.
3180 </clix:description></blockquote></p>
3182 <p xmlns=""><a class="none" name="ssl-p"></a>
3183 [Function]
3184 <br><b>ssl-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
3185 <tt>&amp;optional
3186 </tt> acceptor
3187 </clix:lambda-list></i>
3188 =&gt;
3189 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">generalized-boolean
3190 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3191 Whether the current connection to the client is secure. See <code><a href="#acceptor-ssl-p">ACCEPTOR-SSL-P</a></code>.
3192 </clix:description></blockquote></p>
3194 <p xmlns=""><a class="none" name="reason-phrase"></a>
3195 [Function]
3196 <br><b>reason-phrase</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">return-code
3197 </clix:lambda-list></i>
3198 =&gt;
3199 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
3200 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3201 Returns a reason phrase for the HTTP return code <code><i>return-code</i></code>
3202 (which should be an integer) or <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> for return codes Hunchentoot
3203 doesn't know.
3204 </clix:description></blockquote></p>
3206 <p xmlns=""><a class="none" name="rfc-1123-date"></a>
3207 [Function]
3208 <br><b>rfc-1123-date</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
3209 <tt>&amp;optional
3210 </tt> time
3211 </clix:lambda-list></i>
3212 =&gt;
3213 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
3214 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3215 Generates a time string according to <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.faqs.org/rfcs/rfc1123.html">RFC 1123</a>. Default is current time.
3216 This can be used to send a 'Last-Modified' header - see <code><a href="#handle-if-modified-since">HANDLE-IF-MODIFIED-SINCE</a></code>.
3217 </clix:description></blockquote></p>
3219 <p xmlns=""><a class="none" name="url-encode"></a>
3220 [Function]
3221 <br><b>url-encode</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">string
3222 <tt>&amp;optional
3223 </tt> external-format
3224 </clix:lambda-list></i>
3225 =&gt;
3226 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
3227 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3228 URL-encodes a string using the external format <code><i>external-format</i></code>. The default for <code><i>external-format</i></code> is the value of <code><a href="#*hunchentoot-default-external-format*">*HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT*</a></code>.
3229 </clix:description></blockquote></p>
3231 <p xmlns=""><a class="none" name="url-decode"></a>
3232 [Function]
3233 <br><b>url-decode</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">string
3234 <tt>&amp;optional
3235 </tt> external-format
3236 </clix:lambda-list></i>
3237 =&gt;
3238 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">string
3239 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3240 Decodes a URL-encoded string which is assumed to
3241 be encoded using the external
3242 format <code><i>external-format</i></code>, i.e. this is the inverse
3243 of <code><a href="#url-encode">URL-ENCODE</a></code>. It is assumed that you'll rarely
3244 need this function, if ever. But just in case - here it is. The
3245 default for <code><i>external-format</i></code> is the value
3246 of <code><a href="#*hunchentoot-default-external-format*">*HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT*</a></code>.
3247 </clix:description></blockquote></p>
3249 <p xmlns=""><a class="none" name="escape-for-html"></a>
3250 [Function]
3251 <br><b>escape-for-html</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">string
3252 </clix:lambda-list></i>
3253 =&gt;
3254 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
3255 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3256 Escapes the characters #\&lt;, #\&gt;, #\', #\", and #\&amp; for HTML output.
3257 </clix:description></blockquote></p>
3259 <p xmlns=""><a class="none" name="http-token-p"></a>
3260 [Function]
3261 <br><b>http-token-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">object</clix:lambda-list></i>
3262 =&gt;
3263 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">generalized-boolean</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3264 This function tests whether <code><i>object</i></code> is a
3265 non-empty string which is a <em xmlns="http://www.w3.org/1999/xhtml">token</em> according
3266 to <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.faqs.org/rfcs/rfc2068.html">RFC
3267 2068</a> (i.e. whether it may be used for, say, cookie names).
3268 </clix:description></blockquote></p>
3270 <p xmlns=""><a class="none" name="mime-type"></a>
3271 [Function]
3272 <br><b>mime-type</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">pathspec
3273 </clix:lambda-list></i>
3274 =&gt;
3275 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">result
3276 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3277 Given a pathname designator <code><i>pathspec</i></code> returns the <a xmlns="http://www.w3.org/1999/xhtml" href="http://en.wikipedia.org/wiki/Internet_media_type">MIME type</a>
3278 (as a string) corresponding to the suffix of the file denoted by
3279 <code><i>pathspec</i></code> (or <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>).
3280 </clix:description></blockquote></p>
3282 <p xmlns=""><a class="none" name="within-request-p"></a>
3283 [Function]
3284 <br><b>within-request-p</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">
3285 </clix:lambda-list></i>
3286 =&gt;
3287 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">generalized-boolean
3288 </clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3289 Returns true if in the context of a request. Otherwise, <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>.
3290 </clix:description></blockquote></p>
3292 <p xmlns=""><a class="none" name="*tmp-directory*"></a>
3293 [Special variable]
3294 <br><b>*tmp-directory*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3295 This should be a pathname denoting a directory where temporary
3296 files can be stored. It is used for <a xmlns="http://www.w3.org/1999/xhtml" href="#upload">file
3297 uploads</a>.
3298 </clix:description></blockquote></p>
3300 <p xmlns=""><a class="none" name="*header-stream*"></a>
3301 [Special variable]
3302 <br><b>*header-stream*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3303 If this variable is not <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>, it should be bound to a stream to
3304 which incoming and outgoing headers will be written for debugging
3305 purposes.
3306 </clix:description></blockquote></p>
3309 <p xmlns=""><a class="none" name="*cleanup-function*"></a>
3310 [Special variable]
3311 <br><b>*cleanup-function*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3312 A designator for a function without arguments which is called on a
3313 regular basis if <code><a href="#*cleanup-interval*">*CLEANUP-INTERVAL*</a></code> is not <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>. The initial value is
3314 the name of a function which invokes a garbage collection on 32-bit
3315 versions of LispWorks.
3316 <p xmlns="http://www.w3.org/1999/xhtml">
3317 This variable is only available on LispWorks.
3318 </p>
3319 </clix:description></blockquote></p>
3321 <p xmlns=""><a class="none" name="*cleanup-interval*"></a>
3322 [Special variable]
3323 <br><b>*cleanup-interval*</b><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3324 Should be <code xmlns="http://www.w3.org/1999/xhtml">NIL</code> or a positive integer. The system calls
3325 <code><a href="#*cleanup-function*">*CLEANUP-FUNCTION*</a></code>
3326 whenever <code><a href="#*cleanup-interval*">*CLEANUP-INTERVAL*</a></code> new worker threads
3327 (counted globally across all acceptors) have been created unless the
3328 value is <code xmlns="http://www.w3.org/1999/xhtml">NIL</code>. The initial value is 100.
3329 <p xmlns="http://www.w3.org/1999/xhtml">
3330 This variable is only available on LispWorks.
3331 </p>
3332 </clix:description></blockquote></p>
3336 <h3 xmlns=""><a class="none" name="testing">Testing</a></h3>
3337 Hunchentoot comes with a test script which verifies that the
3338 example web server responds as expected. This test script uses the
3339 <a href="http://weitz.de/drakma/">Drakma</a> HTTP client library
3340 and thus shares a significant amount of its base code with
3341 Hunchentoot itself. Still, running the test script is a useful
3342 confidence test, and it is also possible to run the script across
3343 machines in order to verify a new Hunchentoot (or, for that matter
3344 Drakma) port.
3346 To run the confidence test, <a href="#start">start
3347 the example web server</a>. Then, in your Lisp
3348 listener, type
3349 <pre>(<a class="noborder" href="hunchentoot-test:test-hunchentoot">hunchentoot-test:test-hunchentoot</a> "http://localhost:4242")</pre>
3350 You will see some diagnostic output and a summary line that
3351 reports whether any tests have failed. (You can also use the
3352 example certificate and key files in the test directory and
3353 start and test an https server instead.)
3354 </p>
3356 <p xmlns=""><a class="none" name="hunchentoot-test:test-hunchentoot"></a>
3357 [Function]
3358 <br><b>hunchentoot-test:test-hunchentoot</b> <i><clix:lambda-list xmlns:clix="http://bknr.net/clixdoc">base-url <tt>&amp;key</tt></clix:lambda-list></i>
3359 =&gt;
3360 <i><clix:returns xmlns:clix="http://bknr.net/clixdoc">|</clix:returns></i><blockquote><clix:description xmlns:clix="http://bknr.net/clixdoc">
3361 Runs the built-in confidence
3362 test. <code><i>base-url</i></code> is the base URL to use
3363 for testing, it should not have a trailing slash. The keyword
3364 arguments accepted are for future extension and should not
3365 currently be used.
3366 <p xmlns="http://www.w3.org/1999/xhtml">
3367 The script expects the Hunchentoot example test server to be
3368 running at the given <code xmlns=""><i>base-url</i></code> and
3369 retrieves various pages from that server, expecting certain
3370 responses.
3371 </p>
3372 </clix:description></blockquote></p>
3375 <h3 xmlns=""><a class="none" name="debugging">Debugging</a></h3>
3376 By default, Hunchentoot intercepts all errors that occur while
3377 executing request handlers, logs them to the log file and displays
3378 a static error page to the user. While developing applications,
3379 you may want to change that behavior so that the debugger is
3380 invoked when an error occurs. You can set
3381 the <code xmlns=""><a href="#*catch-errors-p*">*CATCH-ERRORS-P*</a></code> to <code>NIL</code> to
3382 make that happen. Alternatively, you may want to have Hunchentoot
3383 display detailed error information in the error response page.
3384 You can set the <code xmlns=""><a href="#*show-lisp-errors-p*">*SHOW-LISP-ERRORS-P*</a></code> to a
3385 true value to make that happen. If you don't want to see Lisp
3386 backtraces in these error pages, you can
3387 set <code xmlns=""><a href="#*show-lisp-backtraces-p*">*SHOW-LISP-BACKTRACES-P*</a></code>
3388 to <code>NIL</code>.
3391 <h3 xmlns=""><a class="none" name="history">History</a></h3>
3393 Hunchentoot's predecessor <a href="http://weitz.de/tbnl/">TBNL</a>
3394 (which is short for "To Be Named Later") grew over the years as a
3395 toolkit that I used for various commercial and private
3396 projects. In August 2003, Daniel Barlow started
3397 a <a href="http://article.gmane.org/gmane.lisp.web/148">review of
3398 web APIs</a> on
3399 the <a href="http://www.red-bean.com/lispweb/">lispweb</a> mailing
3400 list and
3401 I <a href="http://article.gmane.org/gmane.lisp.web/153">described</a>
3402 the API of my hitherto-unreleased bunch of code (and christened it
3403 "TBNL").
3405 It turned out that
3406 <a href="http://www.jeffcaldwell.com/">Jeff Caldwell</a> had
3407 worked on something similar so he emailed me and proposed to
3408 join our efforts. As I had no immediate plans to release my code
3409 (which was poorly organized, undocumented, and mostly
3410 CMUCL-specific), I gave it to Jeff and he worked towards a
3411 release. He added docstrings, refactored, added some stuff, and
3412 based it on KMRCL to make it portable across several Lisp
3413 implementations.
3414 </p>
3416 Unfortunately, Jeff is at least as busy as I am so he didn't
3417 find the time to finish a full release. But in spring 2004 I
3418 needed a documented version of the code for a client of mine who
3419 thought it would be good if the toolkit were publicly available
3420 under an open source license. So I took Jeff's code, refactored
3421 again (to sync with the changes I had done in the meantime), and
3422 added documentation. This resulted in TBNL 0.1.0 (which
3423 initially required mod_lisp as its front-end).
3424 </p>
3426 In March 2005, Bob Hutchinson sent patches which enabled TBNL to
3427 use other front-ends than mod_lisp. This made me aware that
3428 TBNL was already <em>almost</em> a full web server, so
3429 eventually I wrote Hunchentoot which <em>was</em> a full web
3430 server, implemented as a wrapper around TBNL. Hunchentoot 0.1.0
3431 was released at the end of 2005 and was originally
3432 LispWorks-only.
3433 </p>
3435 Hunchentoot 0.4.0, released in October 2006, was the first
3436 release which also worked with other Common Lisp
3437 implementations. It is a major rewrite and also incorporates
3438 most of TBNL and replaces it completely.
3439 </p>
3441 Hunchentoot 1.0.0, released in February 2009, is again a major
3442 rewrite and should be considered work in progress. It moved to
3443 using
3444 the <a href="http://common-lisp.net/project/usocket/">usocket</a>
3445 and <a href="http://common-lisp.net/project/bordeaux-threads/">Bordeaux
3446 Threads</a> libraries for non-LispWorks Lisps, thereby removing most of
3447 the platform dependent code. Threading behaviour was made
3448 controllable through the introduction of
3449 taskmasters. <a href="http://www.cliki.net/mod_lisp">mod_lisp</a>
3450 support and several other things were removed in this release to
3451 simplify the code base (and partly due to the lack of interest).
3452 Several architectural changes (lots of them not
3453 backwards-compatible) were made to ease customization of
3454 Hunchentoot's behaviour. A significant part of the 1.0.0
3455 redesign was done
3456 by <a href="http://netzhansa.blogspot.com/">Hans Hübner</a>.
3457 </p>
3460 <h3 xmlns=""><a class="none" name="index">Symbol index</a></h3>
3462 Here are all exported symbols of the <code>HUNCHENTOOT</code>
3463 package in alphabetical order linked to their corresponding
3464 documentation entries:
3466 <ul xmlns="">
3467 <li>
3468 <code><a href="#*acceptor*">*acceptor*</a></code><span class="entry-type">Special variable</span>
3469 </li>
3470 <li>
3471 <code><a href="#*catch-errors-p*">*catch-errors-p*</a></code><span class="entry-type">Special variable</span>
3472 </li>
3473 <li>
3474 <code><a href="#*cleanup-function*">*cleanup-function*</a></code><span class="entry-type">Special variable</span>
3475 </li>
3476 <li>
3477 <code><a href="#*cleanup-interval*">*cleanup-interval*</a></code><span class="entry-type">Special variable</span>
3478 </li>
3479 <li>
3480 <code><a href="#*content-types-for-url-rewrite*">*content-types-for-url-rewrite*</a></code><span class="entry-type">Special variable</span>
3481 </li>
3482 <li>
3483 <code><a href="#*default-connection-timeout*">*default-connection-timeout*</a></code><span class="entry-type">Special variable</span>
3484 </li>
3485 <li>
3486 <code><a href="#*default-content-type*">*default-content-type*</a></code><span class="entry-type">Special variable</span>
3487 </li>
3488 <li>
3489 <code><a href="#*dispatch-table*">*dispatch-table*</a></code><span class="entry-type">Special variable</span>
3490 </li>
3491 <li>
3492 <code><a href="#*file-upload-hook*">*file-upload-hook*</a></code><span class="entry-type">Special variable</span>
3493 </li>
3494 <li>
3495 <code><a href="#*header-stream*">*header-stream*</a></code><span class="entry-type">Special variable</span>
3496 </li>
3497 <li>
3498 <code><a href="#*hunchentoot-default-external-format*">*hunchentoot-default-external-format*</a></code><span class="entry-type">Special variable</span>
3499 </li>
3500 <li>
3501 <code><a href="#*lisp-errors-log-level*">*lisp-errors-log-level*</a></code><span class="entry-type">Special variable</span>
3502 </li>
3503 <li>
3504 <code><a href="#*lisp-warnings-log-level*">*lisp-warnings-log-level*</a></code><span class="entry-type">Special variable</span>
3505 </li>
3506 <li>
3507 <code><a href="#*log-lisp-backtraces-p*">*log-lisp-backtraces-p*</a></code><span class="entry-type">Special variable</span>
3508 </li>
3509 <li>
3510 <code><a href="#*log-lisp-errors-p*">*log-lisp-errors-p*</a></code><span class="entry-type">Special variable</span>
3511 </li>
3512 <li>
3513 <code><a href="#*log-lisp-warnings-p*">*log-lisp-warnings-p*</a></code><span class="entry-type">Special variable</span>
3514 </li>
3515 <li>
3516 <code><a href="#*methods-for-post-parameters*">*methods-for-post-parameters*</a></code><span class="entry-type">Special variable</span>
3517 </li>
3518 <li>
3519 <code><a href="#*reply*">*reply*</a></code><span class="entry-type">Special variable</span>
3520 </li>
3521 <li>
3522 <code><a href="#*request*">*request*</a></code><span class="entry-type">Special variable</span>
3523 </li>
3524 <li>
3525 <code><a href="#*rewrite-for-session-urls*">*rewrite-for-session-urls*</a></code><span class="entry-type">Special variable</span>
3526 </li>
3527 <li>
3528 <code><a href="#*session*">*session*</a></code><span class="entry-type">Special variable</span>
3529 </li>
3530 <li>
3531 <code><a href="#*session-gc-frequency*">*session-gc-frequency*</a></code><span class="entry-type">Special variable</span>
3532 </li>
3533 <li>
3534 <code><a href="#*session-max-time*">*session-max-time*</a></code><span class="entry-type">Special variable</span>
3535 </li>
3536 <li>
3537 <code><a href="#*session-secret*">*session-secret*</a></code><span class="entry-type">Special variable</span>
3538 </li>
3539 <li>
3540 <code><a href="#*show-lisp-backtraces-p*">*show-lisp-backtraces-p*</a></code><span class="entry-type">Special variable</span>
3541 </li>
3542 <li>
3543 <code><a href="#*show-lisp-errors-p*">*show-lisp-errors-p*</a></code><span class="entry-type">Special variable</span>
3544 </li>
3545 <li>
3546 <code><a href="#*tmp-directory*">*tmp-directory*</a></code><span class="entry-type">Special variable</span>
3547 </li>
3548 <li>
3549 <code><a href="#*use-remote-addr-for-sessions*">*use-remote-addr-for-sessions*</a></code><span class="entry-type">Special variable</span>
3550 </li>
3551 <li>
3552 <code><a href="#*use-user-agent-for-sessions*">*use-user-agent-for-sessions*</a></code><span class="entry-type">Special variable</span>
3553 </li>
3554 <li>
3555 <code><a href="#+http-accepted+">+http-accepted+</a></code><span class="entry-type">Constant</span>
3556 </li>
3557 <li>
3558 <code><a href="#+http-authorization-required+">+http-authorization-required+</a></code><span class="entry-type">Constant</span>
3559 </li>
3560 <li>
3561 <code><a href="#+http-bad-gateway+">+http-bad-gateway+</a></code><span class="entry-type">Constant</span>
3562 </li>
3563 <li>
3564 <code><a href="#+http-bad-request+">+http-bad-request+</a></code><span class="entry-type">Constant</span>
3565 </li>
3566 <li>
3567 <code><a href="#+http-conflict+">+http-conflict+</a></code><span class="entry-type">Constant</span>
3568 </li>
3569 <li>
3570 <code><a href="#+http-continue+">+http-continue+</a></code><span class="entry-type">Constant</span>
3571 </li>
3572 <li>
3573 <code><a href="#+http-created+">+http-created+</a></code><span class="entry-type">Constant</span>
3574 </li>
3575 <li>
3576 <code><a href="#+http-expectation-failed+">+http-expectation-failed+</a></code><span class="entry-type">Constant</span>
3577 </li>
3578 <li>
3579 <code><a href="#+http-failed-dependency+">+http-failed-dependency+</a></code><span class="entry-type">Constant</span>
3580 </li>
3581 <li>
3582 <code><a href="#+http-forbidden+">+http-forbidden+</a></code><span class="entry-type">Constant</span>
3583 </li>
3584 <li>
3585 <code><a href="#+http-gateway-time-out+">+http-gateway-time-out+</a></code><span class="entry-type">Constant</span>
3586 </li>
3587 <li>
3588 <code><a href="#+http-gone+">+http-gone+</a></code><span class="entry-type">Constant</span>
3589 </li>
3590 <li>
3591 <code><a href="#+http-internal-server-error+">+http-internal-server-error+</a></code><span class="entry-type">Constant</span>
3592 </li>
3593 <li>
3594 <code><a href="#+http-length-required+">+http-length-required+</a></code><span class="entry-type">Constant</span>
3595 </li>
3596 <li>
3597 <code><a href="#+http-method-not-allowed+">+http-method-not-allowed+</a></code><span class="entry-type">Constant</span>
3598 </li>
3599 <li>
3600 <code><a href="#+http-moved-permanently+">+http-moved-permanently+</a></code><span class="entry-type">Constant</span>
3601 </li>
3602 <li>
3603 <code><a href="#+http-moved-temporarily+">+http-moved-temporarily+</a></code><span class="entry-type">Constant</span>
3604 </li>
3605 <li>
3606 <code><a href="#+http-multi-status+">+http-multi-status+</a></code><span class="entry-type">Constant</span>
3607 </li>
3608 <li>
3609 <code><a href="#+http-multiple-choices+">+http-multiple-choices+</a></code><span class="entry-type">Constant</span>
3610 </li>
3611 <li>
3612 <code><a href="#+http-no-content+">+http-no-content+</a></code><span class="entry-type">Constant</span>
3613 </li>
3614 <li>
3615 <code><a href="#+http-non-authoritative-information+">+http-non-authoritative-information+</a></code><span class="entry-type">Constant</span>
3616 </li>
3617 <li>
3618 <code><a href="#+http-not-acceptable+">+http-not-acceptable+</a></code><span class="entry-type">Constant</span>
3619 </li>
3620 <li>
3621 <code><a href="#+http-not-found+">+http-not-found+</a></code><span class="entry-type">Constant</span>
3622 </li>
3623 <li>
3624 <code><a href="#+http-not-implemented+">+http-not-implemented+</a></code><span class="entry-type">Constant</span>
3625 </li>
3626 <li>
3627 <code><a href="#+http-not-modified+">+http-not-modified+</a></code><span class="entry-type">Constant</span>
3628 </li>
3629 <li>
3630 <code><a href="#+http-ok+">+http-ok+</a></code><span class="entry-type">Constant</span>
3631 </li>
3632 <li>
3633 <code><a href="#+http-partial-content+">+http-partial-content+</a></code><span class="entry-type">Constant</span>
3634 </li>
3635 <li>
3636 <code><a href="#+http-payment-required+">+http-payment-required+</a></code><span class="entry-type">Constant</span>
3637 </li>
3638 <li>
3639 <code><a href="#+http-precondition-failed+">+http-precondition-failed+</a></code><span class="entry-type">Constant</span>
3640 </li>
3641 <li>
3642 <code><a href="#+http-proxy-authentication-required+">+http-proxy-authentication-required+</a></code><span class="entry-type">Constant</span>
3643 </li>
3644 <li>
3645 <code><a href="#+http-request-entity-too-large+">+http-request-entity-too-large+</a></code><span class="entry-type">Constant</span>
3646 </li>
3647 <li>
3648 <code><a href="#+http-request-time-out+">+http-request-time-out+</a></code><span class="entry-type">Constant</span>
3649 </li>
3650 <li>
3651 <code><a href="#+http-request-uri-too-large+">+http-request-uri-too-large+</a></code><span class="entry-type">Constant</span>
3652 </li>
3653 <li>
3654 <code><a href="#+http-requested-range-not-satisfiable+">+http-requested-range-not-satisfiable+</a></code><span class="entry-type">Constant</span>
3655 </li>
3656 <li>
3657 <code><a href="#+http-reset-content+">+http-reset-content+</a></code><span class="entry-type">Constant</span>
3658 </li>
3659 <li>
3660 <code><a href="#+http-see-other+">+http-see-other+</a></code><span class="entry-type">Constant</span>
3661 </li>
3662 <li>
3663 <code><a href="#+http-service-unavailable+">+http-service-unavailable+</a></code><span class="entry-type">Constant</span>
3664 </li>
3665 <li>
3666 <code><a href="#+http-switching-protocols+">+http-switching-protocols+</a></code><span class="entry-type">Constant</span>
3667 </li>
3668 <li>
3669 <code><a href="#+http-temporary-redirect+">+http-temporary-redirect+</a></code><span class="entry-type">Constant</span>
3670 </li>
3671 <li>
3672 <code><a href="#+http-unsupported-media-type+">+http-unsupported-media-type+</a></code><span class="entry-type">Constant</span>
3673 </li>
3674 <li>
3675 <code><a href="#+http-use-proxy+">+http-use-proxy+</a></code><span class="entry-type">Constant</span>
3676 </li>
3677 <li>
3678 <code><a href="#+http-version-not-supported+">+http-version-not-supported+</a></code><span class="entry-type">Constant</span>
3679 </li>
3680 <li>
3681 <code><a href="#abort-request-handler">abort-request-handler</a></code><span class="entry-type">Function</span>
3682 </li>
3683 <li>
3684 <code><a href="#accept-connections">accept-connections</a></code><span class="entry-type">Generic function</span>
3685 </li>
3686 <li>
3687 <code><a href="#acceptor">acceptor</a></code><span class="entry-type">Standard class</span>
3688 </li>
3689 <li>
3690 <code><a href="#acceptor-access-log-destination">acceptor-access-log-destination</a></code><span class="entry-type">Generic accessor</span>
3691 </li>
3692 <li>
3693 <code><a href="#acceptor-address">acceptor-address</a></code><span class="entry-type">Generic reader</span>
3694 </li>
3695 <li>
3696 <code><a href="#acceptor-dispatch-request">acceptor-dispatch-request</a></code><span class="entry-type">Generic function</span>
3697 </li>
3698 <li>
3699 <code><a href="#acceptor-document-root">acceptor-document-root</a></code><span class="entry-type">Generic accessor</span>
3700 </li>
3701 <li>
3702 <code><a href="#acceptor-error-template-directory">acceptor-error-template-directory</a></code><span class="entry-type">Generic accessor</span>
3703 </li>
3704 <li>
3705 <code><a href="#acceptor-input-chunking-p">acceptor-input-chunking-p</a></code><span class="entry-type">Generic accessor</span>
3706 </li>
3707 <li>
3708 <code><a href="#acceptor-listen-backlog">acceptor-listen-backlog</a></code><span class="entry-type">Generic function</span>
3709 </li>
3710 <li>
3711 <code><a href="#acceptor-log-access">acceptor-log-access</a></code><span class="entry-type">Generic function</span>
3712 </li>
3713 <li>
3714 <code><a href="#acceptor-log-message">acceptor-log-message</a></code><span class="entry-type">Generic function</span>
3715 </li>
3716 <li>
3717 <code><a href="#acceptor-message-log-destination">acceptor-message-log-destination</a></code><span class="entry-type">Generic accessor</span>
3718 </li>
3719 <li>
3720 <code><a href="#acceptor-name">acceptor-name</a></code><span class="entry-type">Generic accessor</span>
3721 </li>
3722 <li>
3723 <code><a href="#acceptor-output-chunking-p">acceptor-output-chunking-p</a></code><span class="entry-type">Generic accessor</span>
3724 </li>
3725 <li>
3726 <code><a href="#acceptor-persistent-connections-p">acceptor-persistent-connections-p</a></code><span class="entry-type">Generic accessor</span>
3727 </li>
3728 <li>
3729 <code><a href="#acceptor-port">acceptor-port</a></code><span class="entry-type">Generic reader</span>
3730 </li>
3731 <li>
3732 <code><a href="#acceptor-read-timeout">acceptor-read-timeout</a></code><span class="entry-type">Generic reader</span>
3733 </li>
3734 <li>
3735 <code><a href="#acceptor-remove-session">acceptor-remove-session</a></code><span class="entry-type">Generic function</span>
3736 </li>
3737 <li>
3738 <code><a href="#acceptor-reply-class">acceptor-reply-class</a></code><span class="entry-type">Generic accessor</span>
3739 </li>
3740 <li>
3741 <code><a href="#acceptor-request-class">acceptor-request-class</a></code><span class="entry-type">Generic accessor</span>
3742 </li>
3743 <li>
3744 <code><a href="#acceptor-ssl-certificate-file">acceptor-ssl-certificate-file</a></code><span class="entry-type">Generic reader</span>
3745 </li>
3746 <li>
3747 <code><a href="#acceptor-ssl-p">acceptor-ssl-p</a></code><span class="entry-type">Generic function</span>
3748 </li>
3749 <li>
3750 <code><a href="#acceptor-ssl-privatekey-file">acceptor-ssl-privatekey-file</a></code><span class="entry-type">Generic reader</span>
3751 </li>
3752 <li>
3753 <code><a href="#acceptor-ssl-privatekey-password">acceptor-ssl-privatekey-password</a></code><span class="entry-type">Generic reader</span>
3754 </li>
3755 <li>
3756 <code><a href="#acceptor-status-message">acceptor-status-message</a></code><span class="entry-type">Generic function</span>
3757 </li>
3758 <li>
3759 <code><a href="#acceptor-write-timeout">acceptor-write-timeout</a></code><span class="entry-type">Generic reader</span>
3760 </li>
3761 <li>
3762 <code><a href="#authorization">authorization</a></code><span class="entry-type">Function</span>
3763 </li>
3764 <li>
3765 <code><a href="#aux-request-value">aux-request-value</a></code><span class="entry-type">Accessor</span>
3766 </li>
3767 <li>
3768 <code><a href="#content-length">content-length</a></code><span class="entry-type">Generic reader</span>
3769 </li>
3770 <li>
3771 <code><a href="#content-length*">content-length*</a></code><span class="entry-type">Accessor</span>
3772 </li>
3773 <li>
3774 <code><a href="#content-type">content-type</a></code><span class="entry-type">Generic reader</span>
3775 </li>
3776 <li>
3777 <code><a href="#content-type*">content-type*</a></code><span class="entry-type">Accessor</span>
3778 </li>
3779 <li>
3780 <code><a href="#cookie-in">cookie-in</a></code><span class="entry-type">Function</span>
3781 </li>
3782 <li>
3783 <code><a href="#cookie-out">cookie-out</a></code><span class="entry-type">Function</span>
3784 </li>
3785 <li>
3786 <code><a href="#cookies-in">cookies-in</a></code><span class="entry-type">Generic reader</span>
3787 </li>
3788 <li>
3789 <code><a href="#cookies-in*">cookies-in*</a></code><span class="entry-type">Function</span>
3790 </li>
3791 <li>
3792 <code><a href="#cookies-out">cookies-out</a></code><span class="entry-type">Generic accessor</span>
3793 </li>
3794 <li>
3795 <code><a href="#cookies-out*">cookies-out*</a></code><span class="entry-type">Accessor</span>
3796 </li>
3797 <li>
3798 <code><a href="#create-folder-dispatcher-and-handler">create-folder-dispatcher-and-handler</a></code><span class="entry-type">Function</span>
3799 </li>
3800 <li>
3801 <code><a href="#create-prefix-dispatcher">create-prefix-dispatcher</a></code><span class="entry-type">Function</span>
3802 </li>
3803 <li>
3804 <code><a href="#create-regex-dispatcher">create-regex-dispatcher</a></code><span class="entry-type">Function</span>
3805 </li>
3806 <li>
3807 <code><a href="#create-request-handler-thread">create-request-handler-thread</a></code><span class="entry-type">Generic function</span>
3808 </li>
3809 <li>
3810 <code><a href="#create-static-file-dispatcher-and-handler">create-static-file-dispatcher-and-handler</a></code><span class="entry-type">Function</span>
3811 </li>
3812 <li>
3813 <code><a href="#define-easy-handler">define-easy-handler</a></code><span class="entry-type">Macro</span>
3814 </li>
3815 <li>
3816 <code><a href="#delete-aux-request-value">delete-aux-request-value</a></code><span class="entry-type">Function</span>
3817 </li>
3818 <li>
3819 <code><a href="#delete-session-value">delete-session-value</a></code><span class="entry-type">Function</span>
3820 </li>
3821 <li>
3822 <code><a href="#detach-socket">detach-socket</a></code><span class="entry-type">Generic function</span>
3823 </li>
3824 <li>
3825 <code><a href="#dispatch-easy-handlers">dispatch-easy-handlers</a></code><span class="entry-type">Function</span>
3826 </li>
3827 <li>
3828 <code><a href="#easy-acceptor">easy-acceptor</a></code><span class="entry-type">Standard class</span>
3829 </li>
3830 <li>
3831 <code><a href="#easy-ssl-acceptor">easy-ssl-acceptor</a></code><span class="entry-type">Standard class</span>
3832 </li>
3833 <li>
3834 <code><a href="#escape-for-html">escape-for-html</a></code><span class="entry-type">Function</span>
3835 </li>
3836 <li>
3837 <code><a href="#execute-acceptor">execute-acceptor</a></code><span class="entry-type">Generic function</span>
3838 </li>
3839 <li>
3840 <code><a href="#get-parameter">get-parameter</a></code><span class="entry-type">Function</span>
3841 </li>
3842 <li>
3843 <code><a href="#get-parameters">get-parameters</a></code><span class="entry-type">Generic reader</span>
3844 </li>
3845 <li>
3846 <code><a href="#get-parameters*">get-parameters*</a></code><span class="entry-type">Function</span>
3847 </li>
3848 <li>
3849 <code><a href="#handle-if-modified-since">handle-if-modified-since</a></code><span class="entry-type">Function</span>
3850 </li>
3851 <li>
3852 <code><a href="#handle-incoming-connection">handle-incoming-connection</a></code><span class="entry-type">Generic function</span>
3853 </li>
3854 <li>
3855 <code><a href="#handle-request">handle-request</a></code><span class="entry-type">Generic function</span>
3856 </li>
3857 <li>
3858 <code><a href="#handle-static-file">handle-static-file</a></code><span class="entry-type">Function</span>
3859 </li>
3860 <li>
3861 <code><a href="#header-in">header-in</a></code><span class="entry-type">Generic reader</span>
3862 </li>
3863 <li>
3864 <code><a href="#header-in*">header-in*</a></code><span class="entry-type">Function</span>
3865 </li>
3866 <li>
3867 <code><a href="#header-out">header-out</a></code><span class="entry-type">Accessor</span>
3868 </li>
3869 <li>
3870 <code><a href="#headers-in">headers-in</a></code><span class="entry-type">Generic reader</span>
3871 </li>
3872 <li>
3873 <code><a href="#headers-in*">headers-in*</a></code><span class="entry-type">Function</span>
3874 </li>
3875 <li>
3876 <code><a href="#headers-out">headers-out</a></code><span class="entry-type">Generic reader</span>
3877 </li>
3878 <li>
3879 <code><a href="#headers-out*">headers-out*</a></code><span class="entry-type">Function</span>
3880 </li>
3881 <li>
3882 <code><a href="#host">host</a></code><span class="entry-type">Function</span>
3883 </li>
3884 <li>
3885 <code><a href="#http-token-p">http-token-p</a></code><span class="entry-type">Function</span>
3886 </li>
3887 <li>
3888 <code><a href="#hunchentoot-condition">hunchentoot-condition</a></code><span class="entry-type">Condition type</span>
3889 </li>
3890 <li>
3891 <code><a href="#hunchentoot-error">hunchentoot-error</a></code><span class="entry-type">Condition type</span>
3892 </li>
3893 <li>
3894 <code><a href="#hunchentoot-test:test-hunchentoot">hunchentoot-test:test-hunchentoot</a></code><span class="entry-type">Function</span>
3895 </li>
3896 <li>
3897 <code><a href="#hunchentoot-warning">hunchentoot-warning</a></code><span class="entry-type">Condition type</span>
3898 </li>
3899 <li>
3900 <code><a href="#initialize-connection-stream">initialize-connection-stream</a></code><span class="entry-type">Generic function</span>
3901 </li>
3902 <li>
3903 <code><a href="#local-addr">local-addr</a></code><span class="entry-type">Generic reader</span>
3904 </li>
3905 <li>
3906 <code><a href="#local-addr*">local-addr*</a></code><span class="entry-type">Function</span>
3907 </li>
3908 <li>
3909 <code><a href="#local-port">local-port</a></code><span class="entry-type">Generic reader</span>
3910 </li>
3911 <li>
3912 <code><a href="#local-port*">local-port*</a></code><span class="entry-type">Function</span>
3913 </li>
3914 <li>
3915 <code><a href="#log-message*">log-message*</a></code><span class="entry-type">Function</span>
3916 </li>
3917 <li>
3918 <code><a href="#maybe-invoke-debugger">maybe-invoke-debugger</a></code><span class="entry-type">Generic function</span>
3919 </li>
3920 <li>
3921 <code><a href="#mime-type">mime-type</a></code><span class="entry-type">Function</span>
3922 </li>
3923 <li>
3924 <code><a href="#multi-threaded-taskmaster">multi-threaded-taskmaster</a></code><span class="entry-type">Standard class</span>
3925 </li>
3926 <li>
3927 <code><a href="#next-session-id">next-session-id</a></code><span class="entry-type">Generic function</span>
3928 </li>
3929 <li>
3930 <code><a href="#no-cache">no-cache</a></code><span class="entry-type">Function</span>
3931 </li>
3932 <li>
3933 <code><a href="#one-thread-per-connection-taskmaster">one-thread-per-connection-taskmaster</a></code><span class="entry-type">Standard class</span>
3934 </li>
3935 <li>
3936 <code><a href="#parameter">parameter</a></code><span class="entry-type">Function</span>
3937 </li>
3938 <li>
3939 <code><a href="#parameter-error">parameter-error</a></code><span class="entry-type">Condition type</span>
3940 </li>
3941 <li>
3942 <code><a href="#post-parameter">post-parameter</a></code><span class="entry-type">Function</span>
3943 </li>
3944 <li>
3945 <code><a href="#post-parameters">post-parameters</a></code><span class="entry-type">Generic reader</span>
3946 </li>
3947 <li>
3948 <code><a href="#post-parameters*">post-parameters*</a></code><span class="entry-type">Function</span>
3949 </li>
3950 <li>
3951 <code><a href="#process-connection">process-connection</a></code><span class="entry-type">Generic function</span>
3952 </li>
3953 <li>
3954 <code><a href="#process-request">process-request</a></code><span class="entry-type">Generic function</span>
3955 </li>
3956 <li>
3957 <code><a href="#query-string">query-string</a></code><span class="entry-type">Generic reader</span>
3958 </li>
3959 <li>
3960 <code><a href="#query-string*">query-string*</a></code><span class="entry-type">Function</span>
3961 </li>
3962 <li>
3963 <code><a href="#raw-post-data">raw-post-data</a></code><span class="entry-type">Function</span>
3964 </li>
3965 <li>
3966 <code><a href="#real-remote-addr">real-remote-addr</a></code><span class="entry-type">Function</span>
3967 </li>
3968 <li>
3969 <code><a href="#reason-phrase">reason-phrase</a></code><span class="entry-type">Function</span>
3970 </li>
3971 <li>
3972 <code><a href="#recompute-request-parameters">recompute-request-parameters</a></code><span class="entry-type">Function</span>
3973 </li>
3974 <li>
3975 <code><a href="#redirect">redirect</a></code><span class="entry-type">Function</span>
3976 </li>
3977 <li>
3978 <code><a href="#referer">referer</a></code><span class="entry-type">Function</span>
3979 </li>
3980 <li>
3981 <code><a href="#remote-addr">remote-addr</a></code><span class="entry-type">Generic reader</span>
3982 </li>
3983 <li>
3984 <code><a href="#remote-addr*">remote-addr*</a></code><span class="entry-type">Function</span>
3985 </li>
3986 <li>
3987 <code><a href="#remote-port">remote-port</a></code><span class="entry-type">Generic reader</span>
3988 </li>
3989 <li>
3990 <code><a href="#remote-port*">remote-port*</a></code><span class="entry-type">Function</span>
3991 </li>
3992 <li>
3993 <code><a href="#remove-session">remove-session</a></code><span class="entry-type">Function</span>
3994 </li>
3995 <li>
3996 <code><a href="#reply">reply</a></code><span class="entry-type">Standard class</span>
3997 </li>
3998 <li>
3999 <code><a href="#reply-external-format">reply-external-format</a></code><span class="entry-type">Generic accessor</span>
4000 </li>
4001 <li>
4002 <code><a href="#reply-external-format*">reply-external-format*</a></code><span class="entry-type">Accessor</span>
4003 </li>
4004 <li>
4005 <code><a href="#request">request</a></code><span class="entry-type">Standard class</span>
4006 </li>
4007 <li>
4008 <code><a href="#request-acceptor">request-acceptor</a></code><span class="entry-type">Generic reader</span>
4009 </li>
4010 <li>
4011 <code><a href="#request-method">request-method</a></code><span class="entry-type">Generic reader</span>
4012 </li>
4013 <li>
4014 <code><a href="#request-method*">request-method*</a></code><span class="entry-type">Function</span>
4015 </li>
4016 <li>
4017 <code><a href="#request-uri">request-uri</a></code><span class="entry-type">Generic reader</span>
4018 </li>
4019 <li>
4020 <code><a href="#request-uri*">request-uri*</a></code><span class="entry-type">Function</span>
4021 </li>
4022 <li>
4023 <code><a href="#require-authorization">require-authorization</a></code><span class="entry-type">Function</span>
4024 </li>
4025 <li>
4026 <code><a href="#reset-connection-stream">reset-connection-stream</a></code><span class="entry-type">Generic function</span>
4027 </li>
4028 <li>
4029 <code><a href="#reset-session-secret">reset-session-secret</a></code><span class="entry-type">Function</span>
4030 </li>
4031 <li>
4032 <code><a href="#reset-sessions">reset-sessions</a></code><span class="entry-type">Function</span>
4033 </li>
4034 <li>
4035 <code><a href="#return-code">return-code</a></code><span class="entry-type">Generic accessor</span>
4036 </li>
4037 <li>
4038 <code><a href="#return-code*">return-code*</a></code><span class="entry-type">Accessor</span>
4039 </li>
4040 <li>
4041 <code><a href="#rfc-1123-date">rfc-1123-date</a></code><span class="entry-type">Function</span>
4042 </li>
4043 <li>
4044 <code><a href="#script-name">script-name</a></code><span class="entry-type">Generic reader</span>
4045 </li>
4046 <li>
4047 <code><a href="#script-name*">script-name*</a></code><span class="entry-type">Function</span>
4048 </li>
4049 <li>
4050 <code><a href="#send-headers">send-headers</a></code><span class="entry-type">Function</span>
4051 </li>
4052 <li>
4053 <code><a href="#server-protocol">server-protocol</a></code><span class="entry-type">Generic reader</span>
4054 </li>
4055 <li>
4056 <code><a href="#server-protocol*">server-protocol*</a></code><span class="entry-type">Function</span>
4057 </li>
4058 <li>
4059 <code><a href="#session">session</a></code><span class="entry-type">Standard class</span>
4060 </li>
4061 <li>
4062 <code><a href="#session-cookie-name">session-cookie-name</a></code><span class="entry-type">Generic function</span>
4063 </li>
4064 <li>
4065 <code><a href="#session-cookie-value">session-cookie-value</a></code><span class="entry-type">Generic function</span>
4066 </li>
4067 <li>
4068 <code><a href="#session-created">session-created</a></code><span class="entry-type">Generic function</span>
4069 </li>
4070 <li>
4071 <code><a href="#session-db">session-db</a></code><span class="entry-type">Generic accessor</span>
4072 </li>
4073 <li>
4074 <code><a href="#session-db-lock">session-db-lock</a></code><span class="entry-type">Generic function</span>
4075 </li>
4076 <li>
4077 <code><a href="#session-gc">session-gc</a></code><span class="entry-type">Function</span>
4078 </li>
4079 <li>
4080 <code><a href="#session-id">session-id</a></code><span class="entry-type">Generic function</span>
4081 </li>
4082 <li>
4083 <code><a href="#session-max-time">session-max-time</a></code><span class="entry-type">Generic accessor</span>
4084 </li>
4085 <li>
4086 <code><a href="#session-remote-addr">session-remote-addr</a></code><span class="entry-type">Generic function</span>
4087 </li>
4088 <li>
4089 <code><a href="#session-start">session-start</a></code><span class="entry-type">Generic function</span>
4090 </li>
4091 <li>
4092 <code><a href="#session-too-old-p">session-too-old-p</a></code><span class="entry-type">Function</span>
4093 </li>
4094 <li>
4095 <code><a href="#session-user-agent">session-user-agent</a></code><span class="entry-type">Generic function</span>
4096 </li>
4097 <li>
4098 <code><a href="#session-value">session-value</a></code><span class="entry-type">Accessor</span>
4099 </li>
4100 <li>
4101 <code><a href="#session-verify">session-verify</a></code><span class="entry-type">Generic function</span>
4102 </li>
4103 <li>
4104 <code><a href="#set-cookie">set-cookie</a></code><span class="entry-type">Function</span>
4105 </li>
4106 <li>
4107 <code><a href="#set-cookie*">set-cookie*</a></code><span class="entry-type">Function</span>
4108 </li>
4109 <li>
4110 <code><a href="#shutdown">shutdown</a></code><span class="entry-type">Generic function</span>
4111 </li>
4112 <li>
4113 <code><a href="#single-threaded-taskmaster">single-threaded-taskmaster</a></code><span class="entry-type">Standard class</span>
4114 </li>
4115 <li>
4116 <code><a href="#ssl-acceptor">ssl-acceptor</a></code><span class="entry-type">Standard class</span>
4117 </li>
4118 <li>
4119 <code><a href="#ssl-p">ssl-p</a></code><span class="entry-type">Function</span>
4120 </li>
4121 <li>
4122 <code><a href="#start">start</a></code><span class="entry-type">Generic function</span>
4123 </li>
4124 <li>
4125 <code><a href="#start-listening">start-listening</a></code><span class="entry-type">Generic function</span>
4126 </li>
4127 <li>
4128 <code><a href="#start-session">start-session</a></code><span class="entry-type">Function</span>
4129 </li>
4130 <li>
4131 <code><a href="#start-thread">start-thread</a></code><span class="entry-type">Generic function</span>
4132 </li>
4133 <li>
4134 <code><a href="#stop">stop</a></code><span class="entry-type">Generic function</span>
4135 </li>
4136 <li>
4137 <code><a href="#taskmaster">taskmaster</a></code><span class="entry-type">Standard class</span>
4138 </li>
4139 <li>
4140 <code><a href="#taskmaster-acceptor">taskmaster-acceptor</a></code><span class="entry-type">Generic accessor</span>
4141 </li>
4142 <li>
4143 <code><a href="#url-decode">url-decode</a></code><span class="entry-type">Function</span>
4144 </li>
4145 <li>
4146 <code><a href="#url-encode">url-encode</a></code><span class="entry-type">Function</span>
4147 </li>
4148 <li>
4149 <code><a href="#user-agent">user-agent</a></code><span class="entry-type">Function</span>
4150 </li>
4151 <li>
4152 <code><a href="#within-request-p">within-request-p</a></code><span class="entry-type">Function</span>
4153 </li>
4154 </ul>
4158 <h3 xmlns=""><a class="none" name="ack">Acknowledgements</a></h3>
4160 Thanks to Jeff Caldwell - TBNL would not have been released
4161 without his efforts. Thanks
4162 to <a href="http://www.cliki.net/Stefan%20Scholl">Stefan
4163 Scholl</a> and Travis Cross for various additions and fixes to
4164 TBNL, to <a href="http://www.foldr.org/~michaelw/">Michael
4165 Weber</a> for initial file upload code, and
4166 to <a href="http://www.ltn.lv/~jonis/">Janis Dzerins</a> for
4167 his <a href="http://common-lisp.net/project/rfc2388/">RFC 2388
4168 code</a>. Thanks to Bob Hutchison for his code for multiple
4169 front-ends (which made me realize that TBNL was already pretty
4170 close to a "real" web server) and the initial UTF-8 example.
4171 Thanks to <a href="http://netzhansa.blogspot.com/">Hans Hübner</a>
4172 for a lot of architectural and implementation enhancements for the
4173 1.0.0 release and also for transferring the documentation to sane
4174 XHTML. Thanks to John
4175 Foderaro's <a href="http://opensource.franz.com/aserve/index.html">AllegroServe</a>
4176 for inspiration. Thanks to <a href="http://www.htg1.de/">Uwe von
4177 Loh</a> for
4178 the <a href="http://www.htg1.de/hunchentoot/hunchentoot.html">Hunchentoot
4179 logo</a>.
4182 Hunchentoot originally used code
4183 from <a href="http://www.cliki.net/ACL-COMPAT">ACL-COMPAT</a>,
4184 specifically the chunking code from Jochen Schmidt. (This has been
4185 replaced by <a href="http://weitz.de/chunga/">Chunga</a>.) When I ported
4186 Hunchentoot to other Lisps than LispWorks, I stole code from
4187 ACL-COMPAT, <a href="http://www.cliki.net/kmrcl">KMRCL</a>,
4188 and <a href="http://www.cliki.net/trivial-sockets">trivial-sockets</a> for
4189 implementation-dependent stuff like sockets and MP. (This has been replaced by
4190 <a href="http://common-lisp.net/project/bordeaux-threads/">Bordeaux
4191 Threads</a>
4192 and <a href="http://common-lisp.net/project/usocket/">usocket</a>.)
4193 </p>
4195 Parts of this documentation were prepared
4196 with <a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a>,
4197 no animals were harmed.
4198 </p>
4201 <a href="http://weitz.de/index.html">BACK TO MY HOMEPAGE
4202 </a>
4203 </p>
4204 </body></html>