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

Re: code flow in svn_fs

From: Greg Stein <gstein_at_lyra.org>
Date: 2003-03-01 16:19:44 CET

On Sat, Mar 01, 2003 at 02:18:23PM +0100, Sander Striker wrote:
>...
> svn_fs_apply_textdelta
> svn_fs__retry_txn(txn_body_apply_textdelta)
> svn_fs__dag_get_edit_stream
> svn_fs__rep_contents_write_stream
> baton = rep_write_get_baton
> stream = svn_stream_create(baton)
> svn_stream_set_write(stream, rep_write_contents)
> svn_stream_set_close(stream, rep_write_close_contents)
>
>
> What happens with the stream from here on? Is it really
> possible that the stream is closed _more than once_?
> The answer lies in the main window handler returned by
> svn_fs_apply_textdelta:
>
> window_consumer(stream)
> svn_fs__retry_txn(txn_body_txdelta_finalize_edits(stream))
> svn_stream_close(stream) <-- !!!
> svn_fs__dag_finalize_edits

Woah! That doesn't look like Good Behavior. Why don't we lose the closer
function on the stream, and just call rep_write_close_contents manually, and
then move the stream closing out to window_consumer() (or simply ignore
closing the thing).

Closing a stream twice isn't doc'd in the streams functions as safe. But we
can define rep_write_close_contents as safe to call multiple times.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 1 16:14:52 2003

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.