Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F23CF18E84 for ; Wed, 5 Aug 2015 15:28:37 +0000 (UTC) Received: (qmail 95831 invoked by uid 500); 5 Aug 2015 15:28:31 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 95805 invoked by uid 500); 5 Aug 2015 15:28:31 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 95795 invoked by uid 99); 5 Aug 2015 15:28:31 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2015 15:28:31 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 760E6AC04EA for ; Wed, 5 Aug 2015 15:28:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1694249 - /subversion/trunk/subversion/libsvn_subr/stream.c Date: Wed, 05 Aug 2015 15:28:31 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150805152831.760E6AC04EA@hades.apache.org> 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)); }