You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/08/05 17:28:31 UTC

svn commit: r1694249 - /subversion/trunk/subversion/libsvn_subr/stream.c

Author: stefan2
Date: Wed Aug  5 15:28:31 2015
New Revision: 1694249

URL: http://svn.apache.org/r1694249
Log:
Fix a limitation in our svn_stream_skip fallback implementation found while
playing around with stream wrappers:  Some streams don't implement read_full,
others don't implement the normal read. Make the fallback code work in either
case.

Note that this is not a problem for any of our currently used stream
implementations.

* subversion/libsvn_subr/stream.c
  (svn_stream_skip): Our default implemenation for skip will work with any
                     read function.  So, fall back to any read function
                     that the stream actually implements.

Modified:
    subversion/trunk/subversion/libsvn_subr/stream.c

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1694249&r1=1694248&r2=1694249&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Wed Aug  5 15:28:31 2015
@@ -197,8 +197,12 @@ svn_error_t *
 svn_stream_skip(svn_stream_t *stream, apr_size_t len)
 {
   if (stream->skip_fn == NULL)
-    return svn_error_trace(
-            skip_default_handler(stream->baton, len, stream->read_full_fn));
+    {
+      svn_read_fn_t read_fn = stream->read_full_fn ? stream->read_full_fn
+                                                   : stream->read_fn;
+      return svn_error_trace(skip_default_handler(stream->baton, len,
+                                                  read_fn));
+    }
 
   return svn_error_trace(stream->skip_fn(stream->baton, len));
 }