[Openmcl-devel] Problem with read-sequence on binary streams

Bill St. Clair wws at clozure.com
Wed Jun 11 04:49:05 PDT 2008


The difference, in case anyone, like me, didn't notice it at first
blush, is changing "read-byte" to "stream-read-byte".

-Bill

On Tue, Jun 10, 2008 at 9:42 PM, Wade Humeniuk <wade.humeniuk at gmail.com> wrote:
> Through using Drakma I believe I have a found a bug for stream-read-vector for
> binary streams.  The problem thread can be found on the drakma-devel
> mailing list
>
> http://common-lisp.net/pipermail/drakma-devel/2008-June/000314.html
>
> The routine is in ./cct/level-1/l1-streams.lisp
>
> the method
>
> (defmethod stream-read-vector ((stream binary-input-stream)
>                               vector start end)
>  (declare (fixnum start end))
>  (do* ((i start (1+ i)))
>       ((= i end) end)
>    (declare (fixnum i))
>    (let* ((b (read-byte stream)))
>      (if (eq b :eof)
>        (return i)
>        (setf (uvref vector i) b)))))
>
> probably should be changed to...
>
> (defmethod stream-read-vector ((stream binary-input-stream)
>                               vector start end)
>  (declare (fixnum start end))
>  (do* ((i start (1+ i)))
>       ((= i end) end)
>    (declare (fixnum i))
>    (let* ((b (stream-read-byte stream)))
>      (if (eq b :eof)
>        (return i)
>        (setf (uvref vector i) b)))))
>
>
> making this change allowed Drakma to work for the
> problem url.
>
> Wade
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>



More information about the Openmcl-devel mailing list