From 3faf8d6bffc5d0fb2525ba37bb504c53366caf9d Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 8 May 2018 03:44:38 +0000 Subject: Import Subversion-1.10.0 --- subversion/libsvn_subr/spillbuf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'subversion/libsvn_subr/spillbuf.c') diff --git a/subversion/libsvn_subr/spillbuf.c b/subversion/libsvn_subr/spillbuf.c index 6b8d15b587f45..c28780bab16d5 100644 --- a/subversion/libsvn_subr/spillbuf.c +++ b/subversion/libsvn_subr/spillbuf.c @@ -242,7 +242,7 @@ svn_spillbuf__write(svn_spillbuf_t *buf, will grow too large. Create the file and place the pending data into the temporary file. */ if (buf->spill == NULL - && (buf->memory_size + len) > buf->maxsize) + && ((buf->maxsize - buf->memory_size) < len)) { SVN_ERR(svn_io_open_unique_file3(&buf->spill, &buf->filename, @@ -265,10 +265,10 @@ svn_spillbuf__write(svn_spillbuf_t *buf, /* Adjust the start offset for reading from the spill file. - ### FIXME: Instead, we should simply discard the memory - buffers; but currently some tests expect to read data in - the same chunk sizes as were written, so we'll leave this - change for later.*/ + This way, the first `buf->memory_size` bytes of data will + be read from the existing in-memory buffers, which makes + more sense than discarding the buffers and re-reading + data from the file. */ buf->spill_start = buf->memory_size; } } -- cgit v1.2.3