guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] read-response-body should return received data when error oc


From: Ian Price
Subject: Re: [PATCH] read-response-body should return received data when error occcurs (V2)
Date: Fri, 16 Mar 2012 16:57:07 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Nala Ginrut <address@hidden> 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"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]