diff options
author | June McEnroe <programble@gmail.com> | 2018-02-22 15:30:12 -0500 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2018-02-22 15:30:12 -0500 |
commit | d37e895fb7955f6090b02a125236282e1858b53c (patch) | |
tree | 3195d6be8245dbc5393a72944a779e12954fc358 /broadcast.c | |
parent | Handle EINTR from kevent (diff) | |
download | stream-d37e895fb7955f6090b02a125236282e1858b53c.tar.gz stream-d37e895fb7955f6090b02a125236282e1858b53c.zip |
Factor out STREAM_SIZE for ingest and broadcast
Diffstat (limited to 'broadcast.c')
-rw-r--r-- | broadcast.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/broadcast.c b/broadcast.c index c31112e..280a552 100644 --- a/broadcast.c +++ b/broadcast.c @@ -33,6 +33,8 @@ #include <util.h> #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); |