Subject: Re: [PATCH 6/8] Add stream helper library

From: Jonathan Nieder <[email-masked]>
Date: Thu, 15 Jul 2010 14:19:57 -0500

Ramkumar Ramachandra wrote:

> From: David Barr <[email-masked]>
> 
> This library provides thread-unsafe fgets()- and fread()-like
> functions where the caller does not have to supply a buffer.  It
> maintains a couple of static buffers and provides an API to use
> them.
> 
> NEEDSWORK: what should buffer_copy_bytes do on error?

For consistency with the rest of vcs-svn, it should do nothing. :)

I would love to see svn-fe diagnosing and recovering somehow from
faulty input.  For now it follows the easier route of just ignoring
(and skipping) confusing input.

Probably this should be mentioned in the man page somewhere.

[...]
> +void buffer_copy_bytes(uint32_t len)
> +{
[...]
> +		if (ferror(infile) || ferror(stdout))
> +			/* NEEDSWORK: handle error. */

The next input/output operation will fail, causing svn-fe to quit
early, so it would not be easy for such an error to go unnoticed.