On 05/08/2012 02:25 PM, Greg Stein wrote:
> On Tue, May 8, 2012 at 11:06 AM, <cmpilato_at_apache.org> wrote:
>> ...
>> +++ subversion/trunk/subversion/libsvn_subr/stream.c Tue May 8 15:06:18 2012
>> ...
>> +/* Implements svn_stream_stream_fn_t */
>> +svn_error_t *
>> +svn_stream_lazyopen_create(svn_stream_t **stream,
>> + svn_stream_lazyopen_func_t open_func,
>> + void *open_baton,
>> + apr_pool_t *result_pool)
>
> Implements what?! That comment seems like a copy/paste-o.
Well, sorta. More like a poorly composed emacs macro. :-)
>> +{
>> + lazyopen_baton_t *lob = apr_pcalloc(result_pool, sizeof(*lob));
>> +
>> + lob->open_func = open_func;
>> + lob->open_baton = open_baton;
>> + lob->real_stream = NULL;
>> + lob->pool = result_pool;
>> +
>> + *stream = svn_stream_create(lob, result_pool);
>> + svn_stream_set_read(*stream, read_handler_lazyopen);
>> + svn_stream_set_skip(*stream, skip_handler_lazyopen);
>> + svn_stream_set_write(*stream, write_handler_lazyopen);
>> + svn_stream_set_close(*stream, close_handler_lazyopen);
>> + svn_stream_set_mark(*stream, mark_handler_lazyopen);
>> + svn_stream_set_seek(*stream, seek_handler_lazyopen);
>> +
>> + return SVN_NO_ERROR;
>> +}
>
> Per my suggestion on IRC, I don't see how this function can ever
> error, or ever need a scratch_pool (no matter how we might
> extend/upgrade it). I'd suggest updating the signature accordingly.
I removed the scratch_pool from svn_stream_lazyopen_create() already, but
forgot about the "don't return an error" bit. Will fix.
I *did* preserve the scratchpool in the open_func() callback, though, and
the one implementation thereof uses it to pass to
svn_wc__db_pristine_read(). But if you think that's unnecessary too, I can
pull it.
--
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet <> www.collab.net <> Enterprise Cloud Development
Received on 2012-05-08 20:39:24 CEST