[flexi-streams-devel] simple bug in in-memory-streams, affects hunchentoot. fix included
Red Daly
reddaly at gmail.com
Thu Jan 11 01:13:07 UTC 2007
Hi,
I have been quietly using Hunchentoot for a while. when I
asdf-installed the latest version of it, I got an error that traced down
the latest flexi-streams.
make-in-memory-input-stream was changed to use keyword arguments instead
of optional arguments, which broke the macro with-input-from-sequence.
Here is a fixed version:
(defmacro with-input-from-sequence ((var sequence &key start end
transformer)
&body body)
"Creates an IN-MEMORY input stream from SEQUENCE using the
parameters START and END, binds VAR to this stream and then
executes the code in BODY. A function TRANSFORMER may optionally
be specified to transform the returned octets. The stream is
automatically closed on exit from WITH-INPUT-FROM-SEQUENCE, no
matter whether the exit is normal or abnormal. The return value
of this macro is the return value of BODY."
(with-rebinding (sequence)
`(let (,var)
(unwind-protect
(progn
(setq ,var (make-in-memory-input-stream ,sequence
:start (or ,start 0)
:end (or ,end
(length ,sequence))
:transformer
,transformer))
, at body)
(when ,var (close ,var))))))
I didn't see anything else affected. i've also attached a diff
thanks,
red daly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flexi-in-memory-bug.diff
Type: text/x-patch
Size: 502 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/flexi-streams-devel/attachments/20070110/1df2dc71/attachment.bin>
More information about the Flexi-streams-devel
mailing list