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

Re: svn commit: r1335566 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/stream.c

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Tue, 8 May 2012 22:20:55 +0400

On Tue, May 8, 2012 at 7:06 PM, <cmpilato_at_apache.org> wrote:
> Author: cmpilato
> Date: Tue May  8 15:06:18 2012
> New Revision: 1335566
>
> URL: http://svn.apache.org/viewvc?rev=1335566&view=rev
> Log:
> Introduce a generic (and as-yet-unused) lazy-open wrapper stream.
>
> * subversion/include/svn_io.h
>  (svn_stream_lazyopen_func_t): New callback function type.
>  (svn_stream_lazyopen_create): New function.
>
> * subversion/libsvn_subr/stream.c
>  (lazyopen_baton_t): New private baton type.
>  (lazyopen_if_unopened, read_handler_lazyopen, skip_handler_lazyopen,
>  write_handler_lazyopen, close_handler_lazyopen,
>  mark_handler_lazyopen, seek_handler_lazyopen): New helper
>    functions, machinery for...
>  (svn_stream_lazyopen_create): ... this new API implemention.
>
> Suggested by: gstein
>
[...]

> +/* Implements svn_close_fn_t */
> +static svn_error_t *
> +close_handler_lazyopen(void *baton)
> +{
> +  lazyopen_baton_t *b = baton;
> +
> +  SVN_ERR(lazyopen_if_unopened(b));
> +  SVN_ERR(svn_stream_close(b->real_stream));
I think we should just no-op in case if wrapped stream is not opened. I meant:
[[[
if (opened)
{
   SVN_ERR(svn_stream_close(b->real_stream));
}
return SVN_NO_ERROR;
]]]

[...]

-- 
Ivan Zhakov
Received on 2012-05-08 20:21:48 CEST

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