subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1233566 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/stream.c
Date Thu, 19 Jan 2012 20:56:35 GMT
Author: hwright
Date: Thu Jan 19 20:56:35 2012
New Revision: 1233566

URL: http://svn.apache.org/viewvc?rev=1233566&view=rev
Log:
Add a public wrapper around our spillbuf-backed stream.

* subversion/include/svn_io.h
  (svn_stream_buffered): New.

* subversion/libsvn_subr/stream.c
  (svn_stream_buffered): New.

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

Modified: subversion/trunk/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1233566&r1=1233565&r2=1233566&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Thu Jan 19 20:56:35 2012
@@ -989,6 +989,14 @@ svn_stream_t *
 svn_stream_from_string(const svn_string_t *str,
                        apr_pool_t *pool);
 
+/** Return a generic stream which implements buffered reads and writes.
+ *  Allocate the stream in @a result_pool
+ *
+ * @since New in 1.8.
+ */
+svn_stream_t *
+svn_stream_buffered(apr_pool_t *result_pool);
+
 /** Return a stream that decompresses all data read and compresses all
  * data written. The stream @a stream is used to read and write all
  * compressed data. All compression data structures are allocated on

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1233566&r1=1233565&r2=1233566&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Thu Jan 19 20:56:35 2012
@@ -45,6 +45,7 @@
 #include "private/svn_error_private.h"
 #include "private/svn_eol_private.h"
 #include "private/svn_io_private.h"
+#include "private/svn_subr_private.h"
 
 
 struct svn_stream_t {
@@ -1642,3 +1643,16 @@ svn_string_from_stream(svn_string_t **re
 
   return SVN_NO_ERROR;
 }
+
+
+/* These are somewhat arbirary, if we ever get good empirical data as to
+   actually valid values, feel free to update them. */
+#define BUFFER_BLOCK_SIZE 1024
+#define BUFFER_MAX_SIZE 100000
+
+svn_stream_t *
+svn_stream_buffered(apr_pool_t *result_pool)
+{
+  return svn_stream__from_spillbuf(BUFFER_BLOCK_SIZE, BUFFER_MAX_SIZE,
+                                   result_pool);
+}



Mime
View raw message