subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1700774 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/stream.c libsvn_subr/subst.c
Date Wed, 02 Sep 2015 11:55:42 GMT
Author: stefan2
Date: Wed Sep  2 11:55:41 2015
New Revision: 1700774

URL: http://svn.apache.org/r1700774
Log:
Revert r1700305.

Modified:
    subversion/trunk/subversion/include/svn_io.h
    subversion/trunk/subversion/libsvn_subr/stream.c
    subversion/trunk/subversion/libsvn_subr/subst.c

Modified: subversion/trunk/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1700774&r1=1700773&r2=1700774&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Wed Sep  2 11:55:41 2015
@@ -910,14 +910,6 @@ typedef svn_error_t *(*svn_stream_mark_f
 typedef svn_error_t *(*svn_stream_seek_fn_t)(void *baton,
                                              const svn_stream_mark_t *mark);
 
-/** Handler function for removing a mark from a generic stream.
- * @see svn_stream_t and svn_stream_remove_mark().
- *
- * @since New in 1.10.
- */
-typedef svn_error_t *(*svn_stream_remove_mark_fn_t)(void *baton,
-                                                    svn_stream_mark_t *mark);
-
 /** Poll handler for generic streams that support incomplete reads, @see
  * svn_stream_t and svn_stream_data_available().
  *
@@ -992,14 +984,6 @@ void
 svn_stream_set_seek(svn_stream_t *stream,
                     svn_stream_seek_fn_t seek_fn);
 
-/** Set @a stream's mark removal function to @a remove_mark_fn
- *
- * @since New in 1.10.
- */
-void
-svn_stream_set_remove_mark(svn_stream_t *stream,
-                           svn_stream_remove_mark_fn_t remove_mark_fn);
-
 /** Set @a stream's data available function to @a data_available_fn
  *
  * @since New in 1.9.
@@ -1385,18 +1369,6 @@ svn_stream_mark(svn_stream_t *stream,
 svn_error_t *
 svn_stream_seek(svn_stream_t *stream, const svn_stream_mark_t *mark);
 
-/** Remove a @a mark from a generic @a stream.  Using this @a mark with
- * svn_stream_seek() afterwards results in undefined behavior.
- *
- * This function returns the #SVN_ERR_STREAM_SEEK_NOT_SUPPORTED error
- * if the stream doesn't implement seeking.
- *
- * @see svn_stream_mark()
- * @since New in 1.10.
- */
-svn_error_t *
-svn_stream_remove_mark(svn_stream_t *stream, svn_stream_mark_t *mark);
-
 /** When a stream supports polling for available data, obtain a boolean
  * indicating whether data is waiting to be read. If the stream doesn't
  * support polling this function returns a #SVN_ERR_STREAM_NOT_SUPPORTED

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1700774&r1=1700773&r2=1700774&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Wed Sep  2 11:55:41 2015
@@ -59,7 +59,6 @@ struct svn_stream_t {
   svn_close_fn_t close_fn;
   svn_stream_mark_fn_t mark_fn;
   svn_stream_seek_fn_t seek_fn;
-  svn_stream_remove_mark_fn_t remove_mark_fn;
   svn_stream_data_available_fn_t data_available_fn;
   svn_stream__is_buffered_fn_t is_buffered_fn;
   apr_file_t *file; /* Maybe NULL */
@@ -132,13 +131,6 @@ svn_stream_set_seek(svn_stream_t *stream
 }
 
 void
-svn_stream_set_remove_mark(svn_stream_t *stream,
-                           svn_stream_remove_mark_fn_t remove_mark_fn)
-{
-  stream->remove_mark_fn = remove_mark_fn;
-}
-
-void
 svn_stream_set_data_available(svn_stream_t *stream,
                               svn_stream_data_available_fn_t data_available_fn)
 {
@@ -259,22 +251,6 @@ svn_stream_seek(svn_stream_t *stream, co
 }
 
 svn_error_t *
-svn_stream_remove_mark(svn_stream_t *stream, svn_stream_mark_t *mark)
-{
-  if (stream->remove_mark_fn == NULL)
-    {
-      if (stream->mark_fn == NULL)
-        return svn_error_create(SVN_ERR_STREAM_SEEK_NOT_SUPPORTED, NULL,
-			        NULL);
-
-       /* This stream simply does not care about existing marks. */
-       return SVN_NO_ERROR;
-    }
-
-  return svn_error_trace(stream->remove_mark_fn(stream->baton, mark));
-}
-
-svn_error_t *
 svn_stream_data_available(svn_stream_t *stream,
                           svn_boolean_t *data_available)
 {
@@ -500,8 +476,7 @@ stream_readline_chunky(svn_stringbuf_t *
   /* Move the stream read pointer to the first position behind the EOL.
    */
   SVN_ERR(svn_stream_seek(stream, mark));
-  SVN_ERR(svn_stream_skip(stream, total_parsed));
-  return svn_error_trace(svn_stream_remove_mark(stream, mark));
+  return svn_error_trace(svn_stream_skip(stream, total_parsed));
 }
 
 /* Guts of svn_stream_readline().
@@ -804,12 +779,6 @@ seek_handler_disown(void *baton, const s
 }
 
 static svn_error_t *
-remove_mark_handler_disown(void *baton, svn_stream_mark_t *mark)
-{
-  return svn_error_trace(svn_stream_remove_mark(baton, mark));
-}
-
-static svn_error_t *
 data_available_disown(void *baton, svn_boolean_t *data_available)
 {
   return svn_error_trace(svn_stream_data_available(baton, data_available));
@@ -831,7 +800,6 @@ svn_stream_disown(svn_stream_t *stream,
   svn_stream_set_write(s, write_handler_disown);
   svn_stream_set_mark(s, mark_handler_disown);
   svn_stream_set_seek(s, seek_handler_disown);
-  svn_stream_set_remove_mark(s, remove_mark_handler_disown);
   svn_stream_set_data_available(s, data_available_disown);
   svn_stream__set_is_buffered(s, is_buffered_handler_disown);
 
@@ -1784,9 +1752,6 @@ struct buffering_stream_wrapper_mark
 {
     /* Absolute position within the stream. */
     svn_filesize_t pos;
-
-    /* The pool that has the cleanup function registered for this mark. */
-    apr_pool_t *pool;
 };
 
 /* Implements svn_stream_t.read_fn for buffering read stream wrappers. */
@@ -1885,7 +1850,6 @@ mark_handler_buffering_wrapper(void *bat
 
   stream_mark = apr_palloc(pool, sizeof(*stream_mark));
   stream_mark->pos = (svn_filesize_t)(btn->buffer_start + btn->buffer_pos);
-  stream_mark->pool = pool;
 
   /* Reference counting: Increment now and schedule automatic the decrement
    * for when the mark is being cleaned up. */
@@ -1936,25 +1900,6 @@ seek_handler_buffering_wrapper(void *bat
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_stream_t.remove_mark_fn for buffering read stream wrappers.
- */
-static svn_error_t *
-remove_mark_handler_buffering_wrapper(void *baton,
-                                      svn_stream_mark_t *mark)
-{
-  struct buffering_stream_wrapper_mark *stream_mark
-    = (struct buffering_stream_wrapper_mark *)mark;
-
-  /* Bookkeeping. */
-  apr_pool_cleanup_run(stream_mark->pool, baton, decrement_mark_count);
-
-  /* Invalidate the mark object so we get an error when trying to use it. */
-  stream_mark->pos = -1;
-  stream_mark->pool = NULL;
-
-  return SVN_NO_ERROR;
-}
-
 /* Implements svn_stream_t.data_available_fn for buffering read stream
  * wrappers. */
 static svn_error_t *
@@ -2024,7 +1969,6 @@ svn_stream_wrap_buffered_read(svn_stream
   svn_stream_set_read2(stream, read_handler_buffering_wrapper, NULL);
   svn_stream_set_mark(stream, mark_handler_buffering_wrapper);
   svn_stream_set_seek(stream, seek_handler_buffering_wrapper);
-  svn_stream_set_remove_mark(stream, remove_mark_handler_buffering_wrapper);
   svn_stream_set_data_available(stream,
                                 data_available_handler_buffering_wrapper);
   svn_stream__set_is_buffered(stream, is_buffered_handler_buffering_wrapper);
@@ -2269,19 +2213,6 @@ seek_handler_lazyopen(void *baton,
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_stream_remove_mark_fn_t */
-static svn_error_t *
-remove_mark_handler_lazyopen(void *baton,
-                             svn_stream_mark_t *mark)
-{
-  lazyopen_baton_t *b = baton;
-
-  SVN_ERR(lazyopen_if_unopened(b));
-  SVN_ERR(svn_stream_remove_mark(b->real_stream, mark));
-
-  return SVN_NO_ERROR;
-}
-
 static svn_error_t *
 data_available_handler_lazyopen(void *baton,
                                 svn_boolean_t *data_available)
@@ -2329,7 +2260,6 @@ svn_stream_lazyopen_create(svn_stream_la
   svn_stream_set_close(stream, close_handler_lazyopen);
   svn_stream_set_mark(stream, mark_handler_lazyopen);
   svn_stream_set_seek(stream, seek_handler_lazyopen);
-  svn_stream_set_remove_mark(stream, remove_mark_handler_lazyopen);
   svn_stream_set_data_available(stream, data_available_handler_lazyopen);
   svn_stream__set_is_buffered(stream, is_buffered_lazyopen);
 

Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1700774&r1=1700773&r2=1700774&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Wed Sep  2 11:55:41 2015
@@ -1431,18 +1431,6 @@ translated_stream_seek(void *baton, cons
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_stream_remove_mark_fn_t. */
-static svn_error_t *
-translated_stream_remove_mark(void *baton, svn_stream_mark_t *mark)
-{
-  struct translated_stream_baton *b = baton;
-  mark_translated_t *mt = (mark_translated_t *)mark;
-
-  SVN_ERR(svn_stream_remove_mark(b->stream, mt->mark));
-
-  return SVN_NO_ERROR;
-}
-
 /* Implements svn_stream__is_buffered_fn_t. */
 static svn_boolean_t
 translated_stream_is_buffered(void *baton)
@@ -1560,7 +1548,6 @@ stream_translated(svn_stream_t *stream,
   svn_stream_set_close(s, translated_stream_close);
   svn_stream_set_mark(s, translated_stream_mark);
   svn_stream_set_seek(s, translated_stream_seek);
-  svn_stream_set_remove_mark(s, translated_stream_remove_mark);
   svn_stream__set_is_buffered(s, translated_stream_is_buffered);
 
   return s;



Mime
View raw message