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

Re: [PATCH] JavaHL: Fix return value from the java svn_stream_t read function to be compatible with the txdelta_next_window function

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Fri, 25 May 2012 12:37:14 -0500

For the record, Vladimir committed this on the branch in r1342682, an
I merged it to trunk in r1342720.

-Hyrum

On Fri, May 25, 2012 at 12:08 PM, Vladimir Berezniker
<vmpn_at_hitechman.com> wrote:
> Greetings,
>
> While working on enhancements for JavaHL I ran into a problem
> implementing svn_txdelta_apply call because txdelta_next_window would
> segfault while trying to calculate the streams checksum. I traced it down
> to code in the InputStream.cpp that returns -1 when end of stream is
> reached.  -1 does not work with txdelta_next_window because it expects 0 to
> indicate end of stream. Spot checking other svn functions, that use streams,
> shows that they check for greater than 0 return value as indication that
> there is data to be process.  Also as far as I can tell  apr_size_t maps
> to size_t, which implies that it is a signed type making 0 more sensible
> than -1 as end of steam indicator.
>
> [[[
>     JavaHL: Fix return value from the java svn_stream_t read function to be
> compatible with the txdelta_next_window function
>
>     [ in subversion/bindings/javahl/native ]
>
>     * InputStream.cpp
>       (read): Return 0 instead of -1 as expected by the txdelta_next_window
> function
> ]]]
>
> Thank you,
>
> Vladimir

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2012-05-25 19:37:45 CEST

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