diff options
author | Wayne Davison <wayned@samba.org> | 2013-11-25 13:12:35 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2013-11-25 13:12:35 -0800 |
commit | 836e0c5df418a9fd0744e9101f05245322f8668a (patch) | |
tree | 75d2bfadba95dec3675c0a87689743a3ec1c2647 /io.c | |
parent | 2cd87086f05d0a6d943e8fa71f7f6b53b5375d56 (diff) | |
download | android_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.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |