[Bese-devel] Send-headers Troubles
Clinton Ebadi
clinton at unknownlamer.org
Thu Feb 7 05:03:10 UTC 2008
I am having a bit of trouble with some code that used to work with
ucw_dev, but throws an error in ucw_ajax. I have an audio-file-window
that is designed to stream audio files to a client:
(defcomponent audio-file-window (window-component)
((audio-file :initarg :audio-file :accessor audio-file)))
(defmethod window-component.content-type ((window audio-file-window))
(audio-file-type (audio-file window)))
;; attempted solution that does not work
(defmethod render :before ((audio-window audio-file-window))
(setf (get-header (context.response *context*) "Content-Length")
(format nil "~D" (audio-file-length (audio-file audio-window)))))
(defmethod render ((audio-window audio-file-window))
(send-headers (context.response *context*)) ; erring line
(write-sequence (audio-data (audio-file audio-window))
(ucw::network-stream (context.response *context*))))
When I attempt to send the headers it throws a headers already sent
error. I tried dropping the send-headers and using a :before on render
to set the Content-Length, but that did not set the header before it
was sent.
So then, when/from-where are headers sent in ucw_ajax? Following the
rerl control flow logic is a bit hairy and I gave up after an hourish
of looking a few weeks ago.
--
Lindsay (Carlton): should i eat more post its
More information about the bese-devel
mailing list