aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2013-11-25 13:12:35 -0800
committerWayne Davison <wayned@samba.org>2013-11-25 13:12:35 -0800
commit836e0c5df418a9fd0744e9101f05245322f8668a (patch)
tree75d2bfadba95dec3675c0a87689743a3ec1c2647 /io.c
parent2cd87086f05d0a6d943e8fa71f7f6b53b5375d56 (diff)
downloadandroid_external_rsync-836e0c5df418a9fd0744e9101f05245322f8668a.tar.gz
android_external_rsync-836e0c5df418a9fd0744e9101f05245322f8668a.tar.bz2
android_external_rsync-836e0c5df418a9fd0744e9101f05245322f8668a.zip
Create and use write_bigbuf() function for extra-large buffer sizes.
Diffstat (limited to 'io.c')
-rw-r--r--io.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/io.c b/io.c
index c5b1ebc4..264824e7 100644
--- a/io.c
+++ b/io.c
@@ -2087,6 +2087,19 @@ void write_longint(int f, int64 x)
#endif
}
+void write_bigbuf(int f, const char *buf, size_t len)
+{
+ size_t half_max = (iobuf.out.size - iobuf.out_empty_len) / 2;
+
+ while (len > half_max + 1024) {
+ write_buf(f, buf, half_max);
+ buf += half_max;
+ len -= half_max;
+ }
+
+ write_buf(f, buf, len);
+}
+
void write_buf(int f, const char *buf, size_t len)
{
size_t pos, siz;