[hunchentoot-devel] Changes in (send-headers) ?

christoph.senjak at web.de christoph.senjak at web.de
Wed Jan 28 20:01:17 UTC 2009


Hello.

Ok, thank you. This new behaviour makes more sense since for most
streamed output you will often want binary output anyway (and if not
can still use flexi-streams). The handler

(defun bla ()
	   (cl-who:with-html-output (out
				     (flexi-streams:make-flexi-stream
				      (hunchentoot:send-headers)))
	     (:html (:head (:title "blafasel"))
		    (:body (:h1 "quak")))))

works (though it is not very useful).

Christoph Senjak

2009/1/28 Edi Weitz <edi at agharta.de>:
> Hi,
>
> Unfortunately, the HTML documentation isn't always up to date in the
> development version and even some of the docstrings might not be fully
> correct anymore.  In the case of send-headers, the docstring /is/
> correct, though, although the change is hard to catch.  The modified
> sentence there is "returns a BINARY stream" instead of "returns a
> stream".  This is one of many changes that we did for performance
> reasons.  So, if you want to send text to this stream, you'll have to
> wrap it with a flexi stream first.
>
> HTH,
> Edi.
>
> On Wed, Jan 28, 2009 at 6:37 AM, css <css at swissjabber.ch> wrote:
>> Hello.
>>
>> I havent used hunchentoot for a while now, so I checked out the
>> svn-repository on http://bknr.net/svn/ediware/ (I hope this is the
>> correct one) and Installed the packages. The server seems to work, but
>> unfortunately, the following code seems not to do:
>>
>> (defun http-seite ()
>>  (with-html-output (out (send-headers))
>>    (:html (:head (:title "Hallo-Welt-Seite"))
>>           (:body (:h1 "Hallo Welt")))))
>> (setf *dispatch-table* (list (create-prefix-dispatcher "/hallo-welt"
>> 'http-seite)))
>> (defvar *server* (start-server :port 8000))
>>
>> When calling http://localhost:8000/hallo-welt, I only get an empty
>> page. For any other URL, i get a "not found" error.
>>
>> When defining the function differently, returning a string, say
>>
>> (defun http-seite ()
>>  (with-html-output-to-string (bla)
>>    (:html (:head (:title "Hallo-Welt-Seite"))
>>           (:body (:h1 "Hallo Welt")))))
>>
>> the whole thing works. Also the more trivial functions
>>
>> (defun http-2 () (write-char #\A (send-headers)))
>>
>> and
>>
>> (defun http-2 () (write-char #\A (send-headers))
>>                  (finish-output (send-headers)))
>>
>> do not produce any output. I read the included documentation, but it
>> seems like (send-headers) hasnt changed its meening according to it,
>> and also the code doesnt say anything else.
>>
>> Any Ideas what I could be doing wrong?
>>
>> Greetings
>> Christoph
>>
>> _______________________________________________
>> tbnl-devel site list
>> tbnl-devel at common-lisp.net
>> http://common-lisp.net/mailman/listinfo/tbnl-devel
>>
>>
>
> _______________________________________________
> tbnl-devel site list
> tbnl-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/tbnl-devel
>




More information about the Tbnl-devel mailing list