From 849f225e70b34c735070f98ece9f04ae349b704a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 28 Feb 2013 18:51:11 +0100 Subject: [PATCH] use a 16K buffer when reading from fifo --- src/commands.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index c7247016..7727fe05 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -55,8 +55,9 @@ Buffer* open_fifo(const String& name , const String& filename, Context& context) Buffer* buffer = new Buffer(name, Buffer::Flags::Fifo | Buffer::Flags::NoUndo); auto watcher = new FDWatcher(fd, [buffer](FDWatcher& watcher) { - char data[4096]; - ssize_t count = read(watcher.fd(), data, 4096); + constexpr size_t buffer_size = 1024 * 16; + char data[buffer_size]; + ssize_t count = read(watcher.fd(), data, buffer_size); buffer->insert(buffer->end()-1, count > 0 ? String(data, data+count) : "*** kak: fifo closed ***\n");