> Not sure which one is better.

My solution's overly general (do you want to do anything other than check 
progress is onRecv?) and relatedly is not as nice for the caller (the desire to 
limit the content received has to be expressed twice, in `onRecv` and in the 
`substr`).

The other solution, I don't think works in all cases. Like this one: 
<https://gist.github.com/MischaU8/1eead273cbd0abb57ca8bfba3e42a263#file-althttpclient-nim-L818>

There are so many callers to `recvFull`, I think putting the limiting logic in 
that function will be cleaner. Anyway I think it's a better solution, to 
implement only the requested feature and to limit the amount requested and only 
return that amount.

Reply via email to