opensubscriber
   Find in this group all groups
 
Unknown more information…

g : guile-devel@gnu.org 17 March 2012 • 12:57AM -0400

Re: [PATCH] read-response-body should return received data when error occcurs (V2)
by Ian Price

REPLY TO AUTHOR
 
REPLY TO GROUP




Nala Ginrut <nalaginrut@gmai...> writes:

> +         (let* ((bv (get-bytevector-n (response-port r) nbytes)))
> +           (if (eof-object? bv)
>                 (bad-response "EOF while reading response body: ~a bytes of ~a"
> -                            (bytevector-length bv) nbytes))))))
> +                            0 nbytes)
> +               bv)))))

This still doesn't answer my concerns. I don't think the user should
have to be checking the length of the result themselves.

(let ((bv (get-bytevector-n (response-port r) nbytes)))
  (cond ((eof-object? bv)
         (incomplete-response ...))
        ((= (bytevector-length bv) nbytes) bv)
        (else
         (incomplete-response ...))))

Am I the only one who feels strongly about this?

--
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.