diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2017-03-23 09:02:34 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2017-03-23 09:53:02 +0100 |
commit | 4038aa23ab80bf52e98ffe69442ccd5e0cf79a89 (patch) | |
tree | f9c5f3ac5179e0590030c11da33934f7580690ea /src/eol.cpp | |
parent | 5069c3b800a5806ef132d187c4ec93d037d55ad2 (diff) | |
download | sciteco-4038aa23ab80bf52e98ffe69442ccd5e0cf79a89.tar.gz |
fixed and optimized piping very large buffers via EC/EG
* test case: HECcat$ on a large buffer (>= 64kb)
truncates the buffer or repeats its beginning
* it turns out that the incremental writing to the process' stdin
was broken. We were always writing data from the beginning of the buffer
which fails if the stdin watcher must be activated more than once.
* Also, EOLWriter::convert() can validly return 0, even if bytes have
been written on the data sink, so this value cannot be used to
check whether the process has closed its stdin.
We now make sure that the entire buffer range is written to stdin.
* Piping large buffers no longer removes the buffer gap.
This makes little difference when filtering via EC since
it will change the buffer gap anyway.
Can make a huge difference when not touching the buffer, though
(e.g. HEGAcat$).
* I did not add a test suite case since that requires
a very large test file and it cannot be easily generated automatically.
Diffstat (limited to 'src/eol.cpp')
-rw-r--r-- | src/eol.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/eol.cpp b/src/eol.cpp index 85c69ba..de503e5 100644 --- a/src/eol.cpp +++ b/src/eol.cpp @@ -249,8 +249,7 @@ EOLReaderMem::convert_all(gsize *out_len) * * @param buffer The buffer to convert. * @parem buffer_len The length of the data in buffer. - * @return The number of bytes written to the data sink, - * i.e. the size of the EOL-normalized data written. + * @return The number of bytes consumed/converted from buffer. */ gsize EOLWriter::convert(const gchar *buffer, gsize buffer_len) |