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