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

Re: [DESIGN] Stacked resources ownership model?

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2005-12-16 23:02:54 CET

> * The decision about whether the bottom-most stream owns its file should be
> made by the code that creates that stream from the file, and subsequent
> functions that play with the stream need not and should not be able to change
> that decision.

> Isn't that the right solution?

Ok. I slept on it and decided to use the svn_client_cat2() example to
illustrate what I *am* talking about.

If you look at svn_client_cat2, you'll find it's passed a stream *out
parameter. I want to create a svn_subst_stream_translated () which
forwards its output to the out stream. Translated streams must be
closed in order to flush the translation buffers.

With the current ownership model, that would be a problem (closing the
translated stream), because it would also close the out stream.
Closing the out stream is no-go, however, since we can't start closing
streams we didn't create.

Looking at the command line client (cmd-cat.c), you can see the out
stream is created once through a call to svn_stream_for_apr_stdout()
and passed to svn_client_cat2 for every target given on the command
line. If the first call closes the stream in order to flush the
translation buffers of the translated stream, that would introduce
real bugs...

Hope I was clearer this time.

bye,

Erik.
Received on Fri Dec 16 23:03:49 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.