Hi Hans,
While investigating the effect of subclassing ACCEPTOR-STATUS-MESSAGE, I came across this behaviour:
CL-USER> (load "srv.lisp")
The value 404 is not of type SEQUENCE. [Condition of type TYPE-ERROR]
--8<---------------cut here---------------start------------->8--- ;;; srv.lisp
(in-package "CL-USER")
(asdf:load-system :hunchentoot) (asdf:load-system :drakma)
(setq tbnl:*catch-errors-p* nil)
(tbnl:start (make-instance 'tbnl:acceptor :document-root nil :error-template-directory nil :address "127.0.0.1" :port 50000))
(write (drakma:http-request "http://127.0.0.1:50000")) --8<---------------cut here---------------end--------------->8---
I've set TBNL:*CATCH-ERRORS-P* to NIL so that you drop into the debugger. This shows that the call (START-OUTPUT 404 ...) results in a (LENGTH 404) call, which is what fails, but it's not obvious (at least not to me) where this LENGTH call is coming from.
Sebastian
On Sun, Mar 31, 2013 at 09:07:53AM +0000, Sebastian Tennant wrote:
Hi Hans,
While investigating the effect of subclassing ACCEPTOR-STATUS-MESSAGE, I came across this behaviour:
[...]
I've set TBNL:*CATCH-ERRORS-P* to NIL so that you drop into the debugger. This shows that the call (START-OUTPUT 404 ...) results in a (LENGTH 404) call, which is what fails, but it's not obvious (at least not to me) where this LENGTH call is coming from.
Does this error message really come from the code you posted? Your code works fine over here (hunchentoot from the latest quicklisp). BTW, what you mean with "subclassing ACCEPTOR-STATUS-MESSAGE" ? Isn't acceptor-status-message a generic function? It almost sounds as if your (?) version of a-s-m returns the http-status-code instead of an error message.
Cheers, Ralf Mattes
Sebastian
Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap
;;; ~/common-home/workspace/hunchentoot/srv.lisp
(in-package "CL-USER")
(asdf:load-system :hunchentoot) (asdf:load-system :drakma)
(setq tbnl:*catch-errors-p* nil)
(tbnl:start (make-instance 'tbnl:acceptor :document-root nil :error-template-directory nil :address "127.0.0.1" :port 50000))
(write (drakma:http-request "http://127.0.0.1:50000"))
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
Quoth rm@seid-online.de:
Does this error message really come from the code you posted?
I'm pretty sure it does, yes.
Your code works fine over here (hunchentoot from the latest quicklisp).
Hmm... odd. I'm also using an up-to-date Quicklisp (and the latest SBCL).
BTW, what you mean with "subclassing ACCEPTOR-STATUS-MESSAGE" ? Isn't acceptor-status-message a generic function?
Yes, of course it is. I meant to say "specialising ACCEPTOR-STATUS-MESSAGE" (on a subclass of ACCEPTOR).
It almost sounds as if your (?) version of a-s-m returns the http-status-code instead of an error message.
The error has nothing to do with a specialised A-S-M. This is out-of-the-box behaviour I'm observing (as the code was intended to show).
Sebastian
BTW, the call to '(length 404)' is probably from within start-output inheaders.lisp.
HTH RalfD
This is fixed in Hunchentoot v1.2.16, thank you for the report.
-Hans
On Sun, Mar 31, 2013 at 11:07 AM, Sebastian Tennant sebyte@smolny.plus.comwrote:
Hi Hans,
While investigating the effect of subclassing ACCEPTOR-STATUS-MESSAGE, I came across this behaviour:
CL-USER> (load "srv.lisp")
The value 404 is not of type SEQUENCE. [Condition of type TYPE-ERROR]
--8<---------------cut here---------------start------------->8--- ;;; srv.lisp
(in-package "CL-USER")
(asdf:load-system :hunchentoot) (asdf:load-system :drakma)
(setq tbnl:*catch-errors-p* nil)
(tbnl:start (make-instance 'tbnl:acceptor :document-root nil :error-template-directory nil :address "127.0.0.1" :port 50000))
(write (drakma:http-request "http://127.0.0.1:50000")) --8<---------------cut here---------------end--------------->8---
I've set TBNL:*CATCH-ERRORS-P* to NIL so that you drop into the debugger. This shows that the call (START-OUTPUT 404 ...) results in a (LENGTH 404) call, which is what fails, but it's not obvious (at least not to me) where this LENGTH call is coming from.
Sebastian
Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel