On 15.02.2014 01:15, breser_at_apache.org wrote:
> Author: breser
> Date: Sat Feb 15 00:15:12 2014
> New Revision: 1568551
>
> URL: http://svn.apache.org/r1568551
> Log:
> Finish ending the use of the deprecated svn_stream_set_read().
Modified: subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp?rev=1568551&r1=1568550&r2=1568551&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp Sat Feb 15 00:15:12 2014
@@ -54,7 +54,8 @@ svn_stream_t *InputStream::getStream(con
// Create a stream with this as the baton and set the read and
// close functions.
svn_stream_t *ret = svn_stream_create(this, pool.getPool());
- svn_stream_set_read(ret, InputStream::read);
+ svn_stream_set_read2(ret, NULL /* only full read support */,
+ InputStream::read);
svn_stream_set_close(ret, InputStream::close);
return ret;
}
Modified: subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp?rev=1568551&r1=1568550&r2=1568551&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp Sat Feb 15 00:15:12 2014
@@ -200,7 +200,8 @@ InputStream::get_global_stream(Env env,
std::auto_ptr<GlobalObject> baton(new GlobalObject(env, jstream));
svn_stream_t* const stream = svn_stream_create(baton.get(), pool.getPool());
- svn_stream_set_read(stream, global_stream_read);
+ svn_stream_set_read2(stream, NULL /* only full read support */,
+ global_stream_read);
I'm pretty sure this is wrong ... have to look at the code and usage
again, but I'm pretty sure that the Java InpuStream.read methods are
actually partial reads, and the implementation has partial-read
semantics, too.
> svn_stream_set_skip(stream, global_stream_skip);
> svn_stream_set_close(stream, global_stream_close_input);
> if (has_mark)
> @@ -223,7 +224,8 @@ svn_stream_t* InputStream::get_stream(co
> const bool has_mark = mark_supported();
>
> svn_stream_t* const stream = svn_stream_create(this, pool.getPool());
> - svn_stream_set_read(stream, stream_read);
> + svn_stream_set_read2(stream, NULL /* only full read support */,
> + stream_read);
> svn_stream_set_skip(stream, stream_skip);
> svn_stream_set_close(stream, stream_close_input);
> if (has_mark)
Yes ... the implementation actually violated the stream API
requirements. Happily, we can fix this now that the stream API got a
partial reader method.
-- Brane
--
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2014-02-18 02:10:30 CET