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

Wade Humeniuk wade.humeniuk at gmail.com
Tue Jun 10 18:42:57 PDT 2008


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



More information about the Openmcl-devel mailing list