[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1144478 - in /subversion/branches/revprop-packing/subversion: include/svn_io.h libsvn_subr/stream.c tests/libsvn_subr/stream-test.c

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 13 Jul 2011 17:27:06 -0400

On Fri, Jul 8, 2011 at 16:12, <hwright_at_apache.org> wrote:
>...
> +++ subversion/branches/revprop-packing/subversion/include/svn_io.h Fri Jul  8 20:12:48 2011
> @@ -1183,6 +1183,12 @@ svn_stream_readline(svn_stream_t *stream
>  * Read the contents of the readable stream @a from and write them to the
>  * writable stream @a to calling @a cancel_func before copying each chunk.
>  *
> + * If @a len is -1, then the entire source stream will be copied, otherwise,
> + * up to @a len bytes will be copied from @a from to @a to.
> + *
> + * @todo ### Should this API return the number of bytes actually copied,
> + * a la svn_stream_read()?
> + *
>  * @a cancel_func may be @c NULL.
>  *
>  * @note both @a from and @a to will be closed upon successful completion of
> @@ -1191,8 +1197,23 @@ svn_stream_readline(svn_stream_t *stream
>  * svn_stream_disown() to protect either or both of the streams from
>  * being closed.
>  *
> + * @since New in 1.7.
> + */
> +svn_error_t *
> +svn_stream_copy4(svn_stream_t *from,
> +                 svn_stream_t *to,
> +                 apr_ssize_t len,
> +                 svn_cancel_func_t cancel_func,
> +                 void *cancel_baton,
> +                 apr_pool_t *pool);

I'm not sure of your intended usage, but note that apr_ssize_t may not
be large enough for a file checked into Subversion. For that, we use
svn_filesize_t (guaranteed 63-bit length). And you could also use
SVN_INVALID_FILESIZE as your "copy all" discriminator. Though that
looks pretty ugly, I would suggset:

#define SVN_STREAM_COPYALL SVN_INVALID_FILESIZE

and tell people to use that define for clarity.

>...

Cheers,
-g
Received on 2011-07-13 23:27:40 CEST

This is an archived mail posted to the Subversion Dev mailing list.