From d37e895fb7955f6090b02a125236282e1858b53c Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 22 Feb 2018 15:30:12 -0500 Subject: Factor out STREAM_SIZE for ingest and broadcast --- broadcast.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'broadcast.c') diff --git a/broadcast.c b/broadcast.c index c31112e..280a552 100644 --- a/broadcast.c +++ b/broadcast.c @@ -33,6 +33,8 @@ #include #endif +#include "stream.h" + static struct termios saveTerm; static void restoreTerm(void) { tcsetattr(STDERR_FILENO, TCSADRAIN, &saveTerm); @@ -113,7 +115,7 @@ int main(int argc, char *argv[]) { if (writeSize < readSize) errx(EX_IOERR, "short write(%d)", remote); totalSize += readSize; - if (totalSize > 1024 * 1024) { + if (totalSize >= STREAM_SIZE) { buf[0] = CTRL('L'); writeSize = write(pty, buf, 1); if (writeSize < 0) err(EX_IOERR, "write(%d)", pty); -- cgit 1.4.1