Revision: 4291
Author: edi
URL: http://bknr.net/trac/changeset/4291
Date
U trunk/thirdparty/drakma/CHANGELOG.txt
Modified: trunk/thirdparty/drakma/CHANGELOG.txt
===================================================================
--- trunk/thirdparty/drakma/CHANGELOG.txt 2009-02-19 01:12:24 UTC (rev 4290)
+++ trunk/thirdparty/drakma/CHANGELOG.txt 2009-02-19 01:18:09 UTC (rev 4291)
@@ -1,5 +1,5 @@
Version 1.0.0
-2009-02-09
+2009-02-19
Use the new ("binary") version of Chunga
Added conditions types
Some performance improvements
Revision: 4290
Author: edi
URL: http://bknr.net/trac/changeset/4290
And more
U trunk/thirdparty/hunchentoot/CHANGELOG
Modified: trunk/thirdparty/hunchentoot/CHANGELOG
===================================================================
--- trunk/thirdparty/hunchentoot/CHANGELOG 2009-02-19 01:11:43 UTC (rev 4289)
+++ trunk/thirdparty/hunchentoot/CHANGELOG 2009-02-19 01:12:24 UTC (rev 4290)
@@ -1,7 +1,7 @@
Version 1.0.0
2009-02-19
-Architectural redesign (thanks to Hans Hübner)
-Lots of small fixes and improvement, too many to enumerate here
+Complete architectural redesign (together with Hans Hübner)
+Lots of small fixes and improvements, too many to enumerate here
Version 0.15.6
2008-04-09
Revision: 4289
Author: edi
URL: http://bknr.net/trac/changeset/4289
Done (?)
U trunk/thirdparty/hunchentoot/CHANGELOG
U trunk/thirdparty/hunchentoot/doc/index.xml
Modified: trunk/thirdparty/hunchentoot/CHANGELOG
===================================================================
--- trunk/thirdparty/hunchentoot/CHANGELOG 2009-02-19 00:36:53 UTC (rev 4288)
+++ trunk/thirdparty/hunchentoot/CHANGELOG 2009-02-19 01:11:43 UTC (rev 4289)
@@ -1,5 +1,5 @@
Version 1.0.0
-2009-02-10
+2009-02-19
Architectural redesign (thanks to Hans Hübner)
Lots of small fixes and improvement, too many to enumerate here
Modified: trunk/thirdparty/hunchentoot/doc/index.xml
===================================================================
--- trunk/thirdparty/hunchentoot/doc/index.xml 2009-02-19 00:36:53 UTC (rev 4288)
+++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-02-19 01:11:43 UTC (rev 4289)
@@ -443,7 +443,8 @@
These are readers for various slots of <clix:ref>ACCEPTOR</clix:ref>
objects (and some of them obviously only make sense
for <clix:ref>SSL-ACCEPTOR</clix:ref> objects). See the docstrings of
-these slots for more information.
+these slots for more information and note that there are corresponding
+initargs for all of them.
</clix:description>
</clix:readers>
@@ -513,16 +514,11 @@
<clix:description>
These are accessors for various slots of <clix:ref>ACCEPTOR</clix:ref>
-objects. See the docstrings of these slots for more information.
+objects. See the docstrings of these slots for more information and
+note that there are corresponding initargs for all of them.
</clix:description>
</clix:accessors>
- <clix:special-variable name='*acceptor*'>
- <clix:description>The current ACCEPTOR object while in the context of a request.
- </clix:description>
- </clix:special-variable>
-
-
<clix:function generic='true' name='acceptor-ssl-p'>
<clix:lambda-list>acceptor
</clix:lambda-list>
@@ -765,66 +761,117 @@
</clix:subchapter>
- <clix:subchapter name="request-dispatch" title="Request dispatch">
+ <clix:subchapter name="request-dispatch" title="Request dispatch and handling">
+The main job of <clix:ref>PROCESS-REQUEST</clix:ref> is to select and
+call a function which handles the request, i.e. which looks at the
+data the client has sent and prepares an appropriate reply to send
+back. This is implemented as follows:
+<p>
+Each acceptor has a <a href="#acceptor-request-dispatcher"><em>request
+dispatcher</em></a> which is a unary function that accepts
+a <clix:ref>REQUEST</clix:ref> object. This function is called by
+<clix:ref>PROCESS-REQUEST</clix:ref>. The idea is that this function
+looks at the request object and depending on its contents decides to
+call another function which "does the work". This "other" function is
+by convention called a <a class="none" name="handlers"><em>request
+handler</em></a>. (Obviously, this is really only a convention as
+process-request doesn't "know" what the request dispatcher does. You
+could as well say that the request dispatcher and the request handler
+have the same job.)
+</p>
+<p>
+The default behaviour, unless you implement your own request
+dispatcher, is that Hunchentoot walks through the list
+*dispatch-table* which consists of <em>dispatch functions</em>. Each
+of these functions accepts the request object as its only argument and
+either returns a request handler to handle the request
+or <code>NIL</code> which means that the next dispatcher in the list
+will be tried. If all dispatch functions return <code>NIL</code>, the
+return code
+<clix:ref>+HTTP-NOT-FOUND+</clix:ref> will be sent to the client.
+</p>
+<p>
+All functions and variables in this section are related to the
+standard request dispatch mechanism described above and are
+meaningless if you're using your own request dispatcher.
+</p>
+<p>
+Request handlers do their work by modifying
+the <a href="#replies">reply object</a> if necessary and by eventually
+returning the response body in the form of a string or a binary
+sequence. As an alternative, they can also
+call <clix:ref>SEND-HEADERS</clix:ref> and write directly to a stream.
+</p>
- <clix:function name='create-folder-dispatcher-and-handler'>
- <clix:lambda-list>uri-prefix base-path
- <clix:lkw>optional
- </clix:lkw> content-type
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Creates and returns a dispatch function which will dispatch to a
-handler function which emits the file relative to BASE-PATH that is
-denoted by the URI of the request relative to URI-PREFIX. URI-PREFIX
-must be a string ending with a slash, BASE-PATH must be a pathname
-designator for an existing directory. If CONTENT-TYPE is not NIL,
-it'll be the content type used for all files in the folder.
+ <clix:special-variable name='*dispatch-table*'>
+ <clix:description>A global list of dispatch functions. The
+ initial value is a list consisting of the two
+ symbols <clix:ref>DISPATCH-EASY-HANDLERS</clix:ref>
+ and <clix:ref>DEFAULT-DISPATCHER</clix:ref>.
</clix:description>
- </clix:function>
- <clix:function name='create-prefix-dispatcher'>
- <clix:lambda-list>prefix handler
+ </clix:special-variable>
+
+ <clix:function name='default-dispatcher'>
+ <clix:lambda-list>request
</clix:lambda-list>
<clix:returns>result
</clix:returns>
- <clix:description>Creates a request dispatch function which will dispatch to the
-function denoted by HANDLER if the file name of the current request
-starts with the string PREFIX.
+ <clix:description>Default dispatch function which handles every request with the
+function stored in <clix:ref>*DEFAULT-HANDLER*</clix:ref>.
</clix:description>
</clix:function>
- <clix:function name='create-regex-dispatcher'>
- <clix:lambda-list>regex handler
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Creates a request dispatch function which will dispatch to the
-function denoted by HANDLER if the file name of the current request
-matches the CL-PPCRE regular expression REGEX.
+
+ <clix:special-variable name='*default-handler*'>
+ <clix:description>The name of the function which is always returned by
+<clix:ref>DEFAULT-DISPATCHER</clix:ref>.
</clix:description>
- </clix:function>
+ </clix:special-variable>
- <clix:function name="handle-static-file">
- <clix:lambda-list>path <clix:lkw>optional</clix:lkw> content-type</clix:lambda-list>
- <clix:returns>nil</clix:returns>
+ <clix:function name="create-prefix-dispatcher">
+ <clix:lambda-list>prefix handler</clix:lambda-list>
+ <clix:returns>dispatch-fn</clix:returns>
<clix:description>
- Sends the file denoted by the pathname designator
- <clix:arg>path</clix:arg> with content type
- <clix:arg>content-type</clix:arg> to the client. Sets the
- necessary handlers. In particular the function employs
- <clix:ref>HANDLE-IF-MODIFIED-SINCE</clix:ref>.
+ A convenience function which will return a dispatcher that
+ returns <clix:arg>handler</clix:arg> whenever the path part of
+ the request URI starts with the
+ string <clix:arg>prefix</clix:arg>.
+ </clix:description>
+ </clix:function>
+
+ <clix:function name="create-regex-dispatcher">
+ <clix:lambda-list>regex handler</clix:lambda-list>
+ <clix:returns>dispatch-fn</clix:returns>
+ <clix:description>
+ A convenience function which will return a dispatcher that
+ returns <clix:arg>handler</clix:arg> whenever the path part of
+ the request URI matches
+ the <a href="http://weitz.de/cl-ppcre/">CL-PPCRE</a> regular
+ expression <clix:arg>regex</clix:arg> (which can be a string, an
+ s-expression, or a scanner).
+ </clix:description>
+ </clix:function>
+
+ <clix:function name="create-folder-dispatcher-and-handler">
+ <clix:lambda-list>uri-prefix base-path <clix:lkw>optional</clix:lkw> content-type</clix:lambda-list>
+ <clix:returns>dispatch-fn</clix:returns>
+ <clix:description>
+ Creates and returns a dispatch function which will dispatch to
+ a handler function which emits the file relative
+ to <clix:arg>base-path</clix:arg> that is denoted by the URI of
+ the request relative
+ to <clix:arg>uri-prefix</clix:arg>. <clix:arg>uri-prefix</clix:arg>
+ must be a string ending with a
+ slash, <clix:arg>base-path</clix:arg> must be a pathname
+ designator for an existing directory.
+ Uses <clix:ref>HANDLE-STATIC-FILE</clix:ref> internally.
<p>
- If <clix:arg>content-type</clix:arg> is <code>NIL</code> the
- function tries to determine the correct content type from
- the file's suffix or falls back
- to <code>"application/octet-stream"</code> as a last resort.
+ If <clix:arg>content-type</clix:arg> is <em>not</em>
+ <code>NIL</code>, it will be used as a the content type for
+ all files in the folder. Otherwise (which is the default)
+ the content type of each file will be
+ determined <a href="#handle-static-file">as usual</a>.
</p>
- <p>
- Note that this function
- calls <clix:ref>SEND-HEADERS</clix:ref> internally, so after
- you've called it, the headers are sent and the return value
- of your handler is ignored.
- </p>
</clix:description>
</clix:function>
@@ -843,15 +890,6 @@
</clix:description>
</clix:function>
- <clix:function name='default-dispatcher'>
- <clix:lambda-list>request
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Default dispatch function which handles every request with the
-function stored in *DEFAULT-HANDLER*.
- </clix:description>
- </clix:function>
<clix:function macro="true" name="define-easy-handler">
<clix:lambda-list>description lambda-list [[declaration* | documentation]] form*</clix:lambda-list>
@@ -1050,65 +1088,14 @@
<clix:returns>result
</clix:returns>
<clix:description>This is a dispatcher which returns the appropriate handler
-defined with DEFINE-EASY-HANDLER, if there is one.
+defined with <clix:ref>DEFINE-EASY-HANDLER</clix:ref>, if there is one.
</clix:description>
</clix:function>
- <clix:special-variable name='*default-handler*'>
- <clix:description>The name of the function which is always returned by
-DEFAULT-DISPATCHER.
- </clix:description>
- </clix:special-variable>
- <clix:special-variable name='*dispatch-table*'>
- <clix:description>A global list of dispatch functions.
- </clix:description>
- </clix:special-variable>
-
</clix:subchapter>
- <clix:subchapter name="handlers" title="Handlers">
-
- <clix:function name='abort-request-handler'>
- <clix:lambda-list>
- <clix:lkw>optional
- </clix:lkw> result
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>This function can be called by a request handler
-at any time to immediately abort handling the request. This works as
-if the handler had returned <clix:arg>result</clix:arg>. See the
-source code of <clix:ref>REDIRECT</clix:ref> for an example.
- </clix:description>
- </clix:function>
-
- <clix:function name="handle-if-modified-since">
- <clix:lambda-list>time <clix:lkw>optional</clix:lkw> request</clix:lambda-list>
- <clix:returns>|</clix:returns>
- <clix:description>
- This function is designed to be used inside
- a <a href="#handlers">handler</a>. If the client has sent an
- 'If-Modified-Since' header
- (see <a href="http://www.faqs.org/rfcs/rfc2616.html">RFC 2616</a>,
- section 14.25) and the time specified matches the universal
- time
- <clix:arg>time</clix:arg> then the
- header <clix:ref>+HTTP-NOT-MODIFIED+</clix:ref> with no content
- is immediately returned to the client.
- <p>
- Note that for this function to be useful you should usually
- send 'Last-Modified' headers back to the client. See the
- code
- of <clix:ref>CREATE-STATIC-FILE-DISPATCHER-AND-HANDLER</clix:ref>
- for an example.
- </p>
- </clix:description>
- </clix:function>
-
- </clix:subchapter>
-
<clix:subchapter name="requests" title="Request objects">
For each incoming request, the <a href="#acceptors">acceptor</a>
@@ -2434,7 +2421,7 @@
<clix:subchapter name="cookies" title="Cookies">
- Outgoing cookies are stored in the request's <code>REPLY</code>
+ Outgoing cookies are stored in the request's <clix:ref>REPLY</clix:ref>
object (see <clix:ref>COOKIE-OUT</clix:ref>
and <clix:ref>COOKIES-OUT*</clix:ref>). They are CLOS objects
defined like this:
@@ -2599,26 +2586,9 @@
<clix:subchapter name="conditions" title="Conditions and error handling">
- <clix:condition name='hunchentoot-condition'>
- <clix:description>Superclass for all conditions related to Hunchentoot.
- </clix:description>
- </clix:condition>
+This section describes how Hunchentoot deals with exceptional
+situations. See also the secion about <a href="#logging">logging</a>.
- <clix:condition name='hunchentoot-error'>
- <clix:description>Superclass for all errors related to Hunchentoot and a subclass of <clix:ref>HUNCHENTOOT-CONDITION</clix:ref>.
- </clix:description>
- </clix:condition>
-
- <clix:condition name='parameter-error'>
- <clix:description>Signalled if a function was called with incosistent or illegal parameters. A subclass of <clix:ref>HUNCHENTOOT-ERROR</clix:ref>.
- </clix:description>
- </clix:condition>
-
- <clix:condition name='hunchentoot-warning'>
- <clix:description>Superclass for all warnings related to Hunchentoot and a subclass of <clix:ref>HUNCHENTOOT-CONDITION</clix:ref>.
- </clix:description>
- </clix:condition>
-
<clix:special-variable name='*show-lisp-errors-p*'>
<clix:description>Whether Lisp errors should be shown in HTML output.
</clix:description>
@@ -2648,10 +2618,94 @@
</clix:description>
</clix:special-variable>
+ <clix:condition name='hunchentoot-condition'>
+ <clix:description>Superclass for all conditions related to Hunchentoot.
+ </clix:description>
+ </clix:condition>
+
+ <clix:condition name='hunchentoot-error'>
+ <clix:description>Superclass for all errors related to Hunchentoot and a subclass of <clix:ref>HUNCHENTOOT-CONDITION</clix:ref>.
+ </clix:description>
+ </clix:condition>
+
+ <clix:condition name='parameter-error'>
+ <clix:description>Signalled if a function was called with incosistent or illegal parameters. A subclass of <clix:ref>HUNCHENTOOT-ERROR</clix:ref>.
+ </clix:description>
+ </clix:condition>
+
+ <clix:condition name='hunchentoot-warning'>
+ <clix:description>Superclass for all warnings related to Hunchentoot and a subclass of <clix:ref>HUNCHENTOOT-CONDITION</clix:ref>.
+ </clix:description>
+ </clix:condition>
+
</clix:subchapter>
<clix:subchapter name="misc" title="Miscellaneous">
+ Various functions and variables which didn't fit into one of the
+ other categories.
+
+ <clix:function name='abort-request-handler'>
+ <clix:lambda-list>
+ <clix:lkw>optional
+ </clix:lkw> result
+ </clix:lambda-list>
+ <clix:returns>result
+ </clix:returns>
+ <clix:description>This function can be called by a request handler
+at any time to immediately abort handling the request. This works as
+if the handler had returned <clix:arg>result</clix:arg>. See the
+source code of <clix:ref>REDIRECT</clix:ref> for an example.
+ </clix:description>
+ </clix:function>
+
+ <clix:function name="handle-if-modified-since">
+ <clix:lambda-list>time <clix:lkw>optional</clix:lkw> request</clix:lambda-list>
+ <clix:returns>|</clix:returns>
+ <clix:description>
+ This function is designed to be used inside
+ a <a href="#handlers">handler</a>. If the client has sent an
+ 'If-Modified-Since' header
+ (see <a href="http://www.faqs.org/rfcs/rfc2616.html">RFC 2616</a>,
+ section 14.25) and the time specified matches the universal
+ time
+ <clix:arg>time</clix:arg> then the
+ header <clix:ref>+HTTP-NOT-MODIFIED+</clix:ref> with no content
+ is immediately returned to the client.
+ <p>
+ Note that for this function to be useful you should usually
+ send 'Last-Modified' headers back to the client. See the
+ code
+ of <clix:ref>CREATE-STATIC-FILE-DISPATCHER-AND-HANDLER</clix:ref>
+ for an example.
+ </p>
+ </clix:description>
+ </clix:function>
+
+ <clix:function name="handle-static-file">
+ <clix:lambda-list>path <clix:lkw>optional</clix:lkw> content-type</clix:lambda-list>
+ <clix:returns>nil</clix:returns>
+ <clix:description>
+ Sends the file denoted by the pathname designator
+ <clix:arg>path</clix:arg> with content type
+ <clix:arg>content-type</clix:arg> to the client. Sets the
+ necessary handlers. In particular the function employs
+ <clix:ref>HANDLE-IF-MODIFIED-SINCE</clix:ref>.
+ <p>
+ If <clix:arg>content-type</clix:arg> is <code>NIL</code> the
+ function tries to determine the correct content type from
+ the file's suffix or falls back
+ to <code>"application/octet-stream"</code> as a last resort.
+ </p>
+ <p>
+ Note that this function
+ calls <clix:ref>SEND-HEADERS</clix:ref> internally, so after
+ you've called it, the headers are sent and the return value
+ of your handler is ignored.
+ </p>
+ </clix:description>
+ </clix:function>
+
<clix:function name="redirect">
<clix:lambda-list>target <clix:lkw>key</clix:lkw> host port protocol add-session-id code</clix:lambda-list>
<clix:returns>|</clix:returns>
Revision: 4288
Author: edi
URL: http://bknr.net/trac/changeset/4288
Yawn...
U trunk/thirdparty/hunchentoot/doc/index.xml
Modified: trunk/thirdparty/hunchentoot/doc/index.xml
===================================================================
--- trunk/thirdparty/hunchentoot/doc/index.xml 2009-02-19 00:20:40 UTC (rev 4287)
+++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-02-19 00:36:53 UTC (rev 4288)
@@ -523,17 +523,6 @@
</clix:special-variable>
- <clix:function name='ssl-p'>
- <clix:lambda-list>
- <clix:lkw>optional
- </clix:lkw> acceptor
- </clix:lambda-list>
- <clix:returns>generalized-boolean
- </clix:returns>
- <clix:description>Whether the current connection to the client is secure. See <clix:ref>ACCEPTOR-SSL-P</clix:ref>.
- </clix:description>
- </clix:function>
-
<clix:function generic='true' name='acceptor-ssl-p'>
<clix:lambda-list>acceptor
</clix:lambda-list>
@@ -814,6 +803,31 @@
matches the CL-PPCRE regular expression REGEX.
</clix:description>
</clix:function>
+
+ <clix:function name="handle-static-file">
+ <clix:lambda-list>path <clix:lkw>optional</clix:lkw> content-type</clix:lambda-list>
+ <clix:returns>nil</clix:returns>
+ <clix:description>
+ Sends the file denoted by the pathname designator
+ <clix:arg>path</clix:arg> with content type
+ <clix:arg>content-type</clix:arg> to the client. Sets the
+ necessary handlers. In particular the function employs
+ <clix:ref>HANDLE-IF-MODIFIED-SINCE</clix:ref>.
+ <p>
+ If <clix:arg>content-type</clix:arg> is <code>NIL</code> the
+ function tries to determine the correct content type from
+ the file's suffix or falls back
+ to <code>"application/octet-stream"</code> as a last resort.
+ </p>
+ <p>
+ Note that this function
+ calls <clix:ref>SEND-HEADERS</clix:ref> internally, so after
+ you've called it, the headers are sent and the return value
+ of your handler is ignored.
+ </p>
+ </clix:description>
+ </clix:function>
+
<clix:function name='create-static-file-dispatcher-and-handler'>
<clix:lambda-list>uri path
<clix:lkw>optional
@@ -828,6 +842,7 @@
determine the content type via the file's suffix.
</clix:description>
</clix:function>
+
<clix:function name='default-dispatcher'>
<clix:lambda-list>request
</clix:lambda-list>
@@ -1055,19 +1070,43 @@
<clix:subchapter name="handlers" title="Handlers">
- <clix:function name='handle-if-modified-since'>
- <clix:lambda-list>time
+ <clix:function name='abort-request-handler'>
+ <clix:lambda-list>
<clix:lkw>optional
- </clix:lkw> request
+ </clix:lkw> result
</clix:lambda-list>
<clix:returns>result
</clix:returns>
- <clix:description>Handles the 'If-Modified-Since' header of REQUEST. The date string
-is compared to the one generated from the supplied universal time
-TIME.
+ <clix:description>This function can be called by a request handler
+at any time to immediately abort handling the request. This works as
+if the handler had returned <clix:arg>result</clix:arg>. See the
+source code of <clix:ref>REDIRECT</clix:ref> for an example.
</clix:description>
</clix:function>
+ <clix:function name="handle-if-modified-since">
+ <clix:lambda-list>time <clix:lkw>optional</clix:lkw> request</clix:lambda-list>
+ <clix:returns>|</clix:returns>
+ <clix:description>
+ This function is designed to be used inside
+ a <a href="#handlers">handler</a>. If the client has sent an
+ 'If-Modified-Since' header
+ (see <a href="http://www.faqs.org/rfcs/rfc2616.html">RFC 2616</a>,
+ section 14.25) and the time specified matches the universal
+ time
+ <clix:arg>time</clix:arg> then the
+ header <clix:ref>+HTTP-NOT-MODIFIED+</clix:ref> with no content
+ is immediately returned to the client.
+ <p>
+ Note that for this function to be useful you should usually
+ send 'Last-Modified' headers back to the client. See the
+ code
+ of <clix:ref>CREATE-STATIC-FILE-DISPATCHER-AND-HANDLER</clix:ref>
+ for an example.
+ </p>
+ </clix:description>
+ </clix:function>
+
</clix:subchapter>
<clix:subchapter name="requests" title="Request objects">
@@ -1799,6 +1838,31 @@
</clix:description>
</clix:accessor>
+ <clix:function name="send-headers">
+ <clix:returns>stream</clix:returns>
+ <clix:description>
+ Sends the initial status line and all headers as determined
+ by the <clix:ref>REPLY</clix:ref>
+ object <clix:ref>*REPLY*</clix:ref>. Returns
+ a <a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_b.htm#binary">binary</a>
+ stream to which the body of the reply can be written. Once
+ this function has been called, further changes
+ to <clix:ref>*REPLY*</clix:ref> don't have any effect.
+ Also, automatic handling of errors (i.e. sending the
+ corresponding status code to the browser, etc.) is turned
+ off for this request and functions
+ like <clix:ref>REDIRECT</clix:ref> or
+ to <clix:ref>ABORT-REQUEST-HANDLER</clix:ref> won't have the
+ desired effect once the headers are sent.
+ <p>
+ If your handlers return the full body as a string or as an
+ array of octets, you should <em>not</em> call this function.
+ If a handler calls <clix:ref>SEND-HEADERS</clix:ref> , its
+ return value is ignored.
+ </p>
+ </clix:description>
+ </clix:function>
+
<clix:accessor name='reply-external-format*'>
<clix:lambda-list>
<clix:lkw>optional
@@ -2588,6 +2652,95 @@
<clix:subchapter name="misc" title="Miscellaneous">
+ <clix:function name="redirect">
+ <clix:lambda-list>target <clix:lkw>key</clix:lkw> host port protocol add-session-id code</clix:lambda-list>
+ <clix:returns>|</clix:returns>
+ <clix:description>
+ Sends back appropriate headers to redirect the client
+ to <clix:arg>target</clix:arg> (a string).
+ <p>
+ If <clix:arg>target</clix:arg> is a full URL starting with a
+ scheme, <clix:arg>host</clix:arg>, <clix:arg>port</clix:arg>,
+ and <clix:arg>protocol</clix:arg> are ignored.
+ Otherwise, <clix:arg>target</clix:arg> should denote the path
+ part of a URL, <clix:arg>protocol</clix:arg> must be one of
+ the keywords <code>:HTTP</code> or <code>:HTTPS</code>, and
+ the URL to redirect to will be constructed
+ from <clix:arg>host</clix:arg>, <clix:arg>port</clix:arg>, <clix:arg>protocol</clix:arg>,
+ and <clix:arg>target</clix:arg>.
+ </p>
+ <p>
+ If <clix:arg>code</clix:arg> is a 3xx redirection code, it
+ will be sent as status code. In case of <code>NIL</code>, a
+ 302 status code will be sent to the client.
+ If <clix:arg>host</clix:arg> is not provided, the current host
+ (see <clix:ref>HOST</clix:ref>) will be
+ used. If <clix:arg>protocol</clix:arg> is the
+ keyword <code>:HTTPS</code>, the client will be redirected
+ to a https URL, if it's <code>:HTTP</code> it'll be sent to
+ a http URL. If both <clix:arg>host</clix:arg>
+ and <clix:arg>protocol</clix:arg> aren't provided, then the
+ value of <clix:arg>protocol</clix:arg> will match the current
+ request.
+ </p>
+ </clix:description>
+ </clix:function>
+
+ <clix:function name="require-authorization">
+ <clix:lambda-list><clix:lkw>optional</clix:lkw> realm</clix:lambda-list>
+ <clix:returns>|</clix:returns>
+ <clix:description>
+ Sends back appropriate headers to require basic HTTP
+ authentication
+ (see <a href="http://www.faqs.org/rfcs/rfc2617.html">RFC 2617</a>)
+ for the realm <clix:arg>realm</clix:arg>. The default value
+ for <clix:arg>realm</clix:arg> is <code>"Hunchentoot"</code>.
+ </clix:description>
+ </clix:function>
+
+ <clix:function name='no-cache'>
+ <clix:lambda-list>
+ </clix:lambda-list>
+ <clix:returns>|
+ </clix:returns>
+ <clix:description>Adds appropriate headers to completely prevent caching on most browsers.
+ </clix:description>
+ </clix:function>
+
+ <clix:function name='ssl-p'>
+ <clix:lambda-list>
+ <clix:lkw>optional
+ </clix:lkw> acceptor
+ </clix:lambda-list>
+ <clix:returns>generalized-boolean
+ </clix:returns>
+ <clix:description>Whether the current connection to the client is secure. See <clix:ref>ACCEPTOR-SSL-P</clix:ref>.
+ </clix:description>
+ </clix:function>
+
+ <clix:function name='reason-phrase'>
+ <clix:lambda-list>return-code
+ </clix:lambda-list>
+ <clix:returns>string
+ </clix:returns>
+ <clix:description>Returns a reason phrase for the HTTP return code <clix:arg>return-code</clix:arg>
+(which should be an integer) or <code>NIL</code> for return codes Hunchentoot
+doesn't know.
+ </clix:description>
+ </clix:function>
+
+ <clix:function name='rfc-1123-date'>
+ <clix:lambda-list>
+ <clix:lkw>optional
+ </clix:lkw> time
+ </clix:lambda-list>
+ <clix:returns>string
+ </clix:returns>
+ <clix:description>Generates a time string according to <a href="http://www.faqs.org/rfcs/rfc1123.html">RFC 1123</a>. Default is current time.
+This can be used to send a 'Last-Modified' header - see <clix:ref>HANDLE-IF-MODIFIED-SINCE</clix:ref>.
+ </clix:description>
+ </clix:function>
+
<clix:function name='url-encode'>
<clix:lambda-list>string
<clix:lkw>optional
@@ -2625,6 +2778,44 @@
</clix:description>
</clix:function>
+ <clix:function name="http-token-p">
+ <clix:lambda-list>object</clix:lambda-list>
+ <clix:returns>generalized-boolean</clix:returns>
+ <clix:description>
+ This function tests whether <clix:arg>object</clix:arg> is a
+ non-empty string which is a <em>token</em> according
+ to <a href="http://www.faqs.org/rfcs/rfc2068.html">RFC
+ 2068</a> (i.e. whether it may be used for, say, cookie names).
+ </clix:description>
+ </clix:function>
+
+ <clix:function name='mime-type'>
+ <clix:lambda-list>pathspec
+ </clix:lambda-list>
+ <clix:returns>result
+ </clix:returns>
+ <clix:description>Given a pathname designator <clix:arg>pathspec</clix:arg> returns the <a href="http://en.wikipedia.org/wiki/Internet_media_type">MIME type</a>
+(as a string) corresponding to the suffix of the file denoted by
+<clix:arg>pathspec</clix:arg> (or <code>NIL</code>).
+ </clix:description>
+ </clix:function>
+
+ <clix:special-variable name="*tmp-directory*">
+ <clix:description>
+ This should be a pathname denoting a directory where temporary
+ files can be stored. It is used for <a href="#upload">file
+ uploads</a>.
+ </clix:description>
+ </clix:special-variable>
+
+ <clix:special-variable name='*header-stream*'>
+ <clix:description>If this variable is not <code>NIL</code>, it should be bound to a stream to
+which incoming and outgoing headers will be written for debugging
+purposes.
+ </clix:description>
+ </clix:special-variable>
+
+
<clix:special-variable name='*cleanup-function*'>
<clix:description>A designator for a function without arguments which is called on a
regular basis if <clix:ref>*CLEANUP-INTERVAL*</clix:ref> is not <code>NIL</code>. The initial value is
@@ -2652,155 +2843,7 @@
</clix:chapter>
- <clix:chapter name='dict' title='The HUNCHENTOOT dictionary'>
- <clix:special-variable name='*header-stream*'>
- <clix:description>If this variable is not NIL, it should be bound to a stream to
-which incoming and outgoing headers will be written for debugging
-purposes.
- </clix:description>
- </clix:special-variable>
-
-
- <clix:special-variable name='*tmp-directory*'>
- <clix:description>Directory for temporary files created by MAKE-TMP-FILE-NAME.
- </clix:description>
- </clix:special-variable>
-
-
- <clix:function name='abort-request-handler'>
- <clix:lambda-list>
- <clix:lkw>optional
- </clix:lkw> result
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>This function can be called by a request handler at any time to
-immediately abort handling the request. This works as if the handler
-had returned RESULT. See the source code of REDIRECT for an example.
- </clix:description>
- </clix:function>
-
-
-
- <clix:function name='handle-static-file'>
- <clix:lambda-list>path
- <clix:lkw>optional
- </clix:lkw> content-type
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>A function which acts like a Hunchentoot handler for the file
-denoted by PATH. Sends a content type header corresponding to
-CONTENT-TYPE or (if that is NIL) tries to determine the content type
-via the file's suffix.
- </clix:description>
- </clix:function>
-
- <clix:function name='http-token-p'>
- <clix:lambda-list>token
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Tests whether TOKEN is a string which is a valid 'token'
-according to HTTP/1.1 (RFC 2068).
- </clix:description>
- </clix:function>
-
-
- <clix:function name='mime-type'>
- <clix:lambda-list>pathspec
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Given a pathname designator PATHSPEC returns the MIME type
-(as a string) corresponding to the suffix of the file denoted by
-PATHSPEC (or NIL).
- </clix:description>
- </clix:function>
-
- <clix:function name='no-cache'>
- <clix:lambda-list>
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Adds appropriate headers to completely prevent caching on most browsers.
- </clix:description>
- </clix:function>
-
-
- <clix:function name='reason-phrase'>
- <clix:lambda-list>return-code
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Returns a reason phrase for the HTTP return code RETURN-CODE
-(which should be an integer) or NIL for return codes Hunchentoot
-doesn't know.
- </clix:description>
- </clix:function>
-
-
- <clix:function name='redirect'>
- <clix:lambda-list>target
- <clix:lkw>key
- </clix:lkw> host port protocol add-session-id code
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Redirects the browser to TARGET which should be a string. If
-TARGET is a full URL starting with a scheme, HOST, PORT and PROTOCOL
-are ignored. Otherwise, TARGET should denote the path part of a URL,
-PROTOCOL must be one of the keywords :HTTP or :HTTPS, and the URL to
-redirect to will be constructed from HOST, PORT, PROTOCOL, and TARGET.
-Adds a session ID if ADD-SESSION-ID is true. If CODE is a 3xx
-redirection code, it will be sent as status code.
- </clix:description>
- </clix:function>
-
-
- <clix:function name='require-authorization'>
- <clix:lambda-list>
- <clix:lkw>optional
- </clix:lkw> realm
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Sends back appropriate headers to require basic HTTP authentication
-(see RFC 2617) for the realm REALM.
- </clix:description>
- </clix:function>
-
- <clix:function name='rfc-1123-date'>
- <clix:lambda-list>
- <clix:lkw>optional
- </clix:lkw> time
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Generates a time string according to RFC 1123. Default is current time.
- </clix:description>
- </clix:function>
-
- <clix:function name='send-headers'>
- <clix:lambda-list>
- </clix:lambda-list>
- <clix:returns>result
- </clix:returns>
- <clix:description>Sends the initial status line and all headers as determined by the
-REPLY object *REPLY*. Returns a binary stream to which the body of
-the reply can be written. Once this function has been called, further
-changes to *REPLY* don't have any effect. Also, automatic handling of
-errors (i.e. sending the corresponding status code to the browser,
-etc.) is turned off for this request. If your handlers return the
-full body as a string or as an array of octets you should NOT call
-this function.
- </clix:description>
- </clix:function>
-
-
- </clix:chapter>
-
<clix:chapter name="testing" title="Testing">
Hunchentoot comes with a test script which verifies that the
example web server responds as expected. This test script uses the
Revision: 4287
Author: edi
URL: http://bknr.net/trac/changeset/4287
Checkpoint
U trunk/thirdparty/hunchentoot/doc/index.xml
U trunk/thirdparty/hunchentoot/request.lisp
Change set too large, please see URL above
Revision: 4286
Author: edi
URL: http://bknr.net/trac/changeset/4286
Replies
U trunk/thirdparty/hunchentoot/doc/index.xml
Modified: trunk/thirdparty/hunchentoot/doc/index.xml
===================================================================
--- trunk/thirdparty/hunchentoot/doc/index.xml 2009-02-18 23:30:05 UTC (rev 4285)
+++ trunk/thirdparty/hunchentoot/doc/index.xml 2009-02-18 23:44:44 UTC (rev 4286)
@@ -1060,7 +1060,8 @@
<clix:subchapter name="requests" title="Request objects">
For each incoming request, the <a href="#acceptors">acceptor</a>
-creates a <clix:ref>REQUEST</clix:ref> object and makes it available
+(in <clix:ref>PROCESS-CONNECTION</clix:ref>) creates
+a <clix:ref>REQUEST</clix:ref> object and makes it available
to <a href="#handlers">handlers</a> via the special variable
<clix:ref>*REQUEST*</clix:ref>. This object contains all relevant
information about the request and this section collects the functions
@@ -1431,67 +1432,94 @@
<clix:subchapter name="replies" title="Reply objects">
+For each incoming request, the <a href="#acceptors">acceptor</a>
+(in <clix:ref>PROCESS-CONNECTION</clix:ref>) creates
+a <clix:ref>REPLY</clix:ref> object and makes it available
+to <a href="#handlers">handlers</a> via the special variable
+<clix:ref>*REPLY*</clix:ref>. This object contains all relevant
+information (except for the content body) about the reply that will be
+sent to the client and this section collects the functions which can
+be used to query and modify such an object. In all function
+where <clix:arg>reply</clix:arg> is an optional or keyword parameter,
+the default is <clix:ref>*REPLY*</clix:ref>.
+
+<p>
+If you need more fine-grained control over the behaviour of reply
+objects, you can subclass <clix:ref>REPLY</clix:ref> and initialize
+the <a href="#acceptor-reply-class"><code>REPLY-CLASS</code></a>
+slot of the <clix:ref>ACCEPTOR</clix:ref> class accordingly. The
+acceptor will generate reply objects of the class named by this
+slot.
+</p>
+
<clix:class name='reply'>
<clix:description>Objects of this class hold all the information
about an outgoing reply. They are created automatically by
Hunchentoot and can be accessed and modified by the corresponding
-handler.
-
+<a href="#handlers">handler</a>.
+<p>
You should not mess with the slots of these objects directly, but you
-can subclass REPLY in order to implement your own behaviour. See the
-REPLY-CLASS slot of the ACCEPTOR class.
+can subclass <clix:ref>REPLY</clix:ref> in order to implement your own behaviour. See the
+<a href="#acceptor-reply-class"><code>:reply-class</code></a> initarg
+of the <clix:ref>ACCEPTOR</clix:ref> class.
+</p>
</clix:description>
</clix:class>
+ <clix:special-variable name='*reply*'>
+ <clix:description>The current <clix:ref>REPLY</clix:ref> object in the context of a request.
+ </clix:description>
+ </clix:special-variable>
- <clix:accessor name='reply-external-format*'>
- <clix:lambda-list>
+
+ <clix:function name='header-out'>
+ <clix:lambda-list>name
<clix:lkw>optional
</clix:lkw> reply
</clix:lambda-list>
- <clix:returns>result
+ <clix:returns>string
</clix:returns>
- <clix:description>The external format of REPLY which is used for character output.
+ <clix:description>
+ <clix:ref>HEADER-OUT</clix:ref> returns the outgoing http header named by the keyword <clix:arg>name</clix:arg> if there is one, otherwise <code>NIL</code>. <code>SETF</code> of <clix:ref>HEADER-OUT</clix:ref> changes the current value of the header named <clix:arg>name</clix:arg>. If no header named <clix:arg>name</clix:arg> exists, it is created. For backwards compatibility, <clix:arg>name</clix:arg> can also be a string in which case the association between a header and its name is case-insensitive.
+<p>
+ Note that the header 'Set-Cookie' cannot be queried by <clix:ref>HEADER-OUT</clix:ref> and must not be set by <code>SETF</code> of <clix:ref>HEADER-OUT</clix:ref>.
+ See also <clix:ref>HEADERS-OUT*</clix:ref>, <clix:ref>CONTENT-TYPE*</clix:ref>, <clix:ref>CONTENT-LENGTH*</clix:ref>, <clix:ref>COOKIES-OUT*</clix:ref>, and <clix:ref>COOKIE-OUT</clix:ref>.
+</p>
</clix:description>
- </clix:accessor>
+ </clix:function>
- <clix:special-variable name='*reply*'>
- <clix:description>The current REPLY object in the context of a request.
- </clix:description>
- </clix:special-variable>
-
- <clix:accessor name='content-length*'>
+ <clix:function name='headers-out*'>
<clix:lambda-list>
<clix:lkw>optional
</clix:lkw> reply
</clix:lambda-list>
- <clix:returns>result
+ <clix:returns>alist
</clix:returns>
- <clix:description>The outgoing 'Content-Length' http header of REPLY.
+ <clix:description>Returns an alist of the outgoing headers associated with the
+<clix:ref>REPLY</clix:ref> object <clix:arg>reply</clix:arg>. See also <clix:ref>HEADER-OUT</clix:ref>.
</clix:description>
- </clix:accessor>
+ </clix:function>
-
- <clix:accessor name='content-type*'>
+ <clix:accessor name='content-length*'>
<clix:lambda-list>
<clix:lkw>optional
</clix:lkw> reply
</clix:lambda-list>
- <clix:returns>result
+ <clix:returns>content-length
</clix:returns>
- <clix:description>The outgoing 'Content-Type' http header of REPLY.
+ <clix:description>The outgoing 'Content-Length' http header of <clix:arg>reply</clix:arg>.
</clix:description>
</clix:accessor>
- <clix:accessor name='cookies-out*'>
+
+ <clix:accessor name='content-type*'>
<clix:lambda-list>
<clix:lkw>optional
</clix:lkw> reply
</clix:lambda-list>
- <clix:returns>result
+ <clix:returns>content-type
</clix:returns>
- <clix:description>Returns an alist of the outgoing cookies associated with the
-REPLY object REPLY.
+ <clix:description>The outgoing 'Content-Type' http header of <clix:arg>reply</clix:arg>.
</clix:description>
</clix:accessor>
@@ -1502,44 +1530,45 @@
</clix:lambda-list>
<clix:returns>result
</clix:returns>
- <clix:description>Returns the current value of the outgoing cookie named
-NAME. Search is case-sensitive.
+ <clix:description>Returns the current value of the outgoing <a href="#cookies">cookie</a> named
+<clix:arg>name</clix:arg>. Search is case-sensitive.
</clix:description>
</clix:function>
- <clix:function name='header-out'>
- <clix:lambda-list>name
+ <clix:accessor name='cookies-out*'>
+ <clix:lambda-list>
<clix:lkw>optional
</clix:lkw> reply
</clix:lambda-list>
- <clix:returns>result
+ <clix:returns>alist
</clix:returns>
- <clix:description>Returns the current value of the outgoing http header named NAME.
-NAME should be a keyword or a string.
+ <clix:description>Returns an alist of the outgoing <a href="#cookies">cookies</a> associated with the
+<clix:ref>REPLY</clix:ref> object <clix:arg>reply</clix:arg>.
</clix:description>
- </clix:function>
+ </clix:accessor>
- <clix:function name='headers-out*'>
+ <clix:accessor name='return-code*'>
<clix:lambda-list>
<clix:lkw>optional
</clix:lkw> reply
</clix:lambda-list>
- <clix:returns>result
+ <clix:returns>return-code
</clix:returns>
- <clix:description>Returns an alist of the outgoing headers associated with the
-REPLY object REPLY.
+ <clix:description>Gets or sets the http return code
+ of <clix:arg>reply</clix:arg>. The return code of
+ each <clix:ref>REPLY</clix:ref> object is initially set
+ to <clix:ref>+HTTP-OK+</clix:ref>.
</clix:description>
- </clix:function>
+ </clix:accessor>
- <clix:accessor name='return-code*'>
+ <clix:accessor name='reply-external-format*'>
<clix:lambda-list>
<clix:lkw>optional
</clix:lkw> reply
</clix:lambda-list>
- <clix:returns>result
+ <clix:returns>external-format
</clix:returns>
- <clix:description>The http return code of REPLY. The return codes Hunchentoot can
-handle are defined in specials.lisp.
+ <clix:description>The external format of <clix:arg>reply</clix:arg> which is used for character output.
</clix:description>
</clix:accessor>
Revision: 4285
Author: edi
URL: http://bknr.net/trac/changeset/4285
Checkpoint
U trunk/thirdparty/hunchentoot/doc/index.xml
Change set too large, please see URL above
Revision: 4284
Author: edi
URL: http://bknr.net/trac/changeset/4284
Checkpoint
U trunk/thirdparty/hunchentoot/doc/index.xml
U trunk/thirdparty/hunchentoot/packages.lisp
U trunk/thirdparty/hunchentoot/session.lisp
U trunk/thirdparty/hunchentoot/specials.lisp
Change set too large, please see URL above