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 --- ingest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ingest.c') diff --git a/ingest.c b/ingest.c index 9fa754d..6ba387b 100644 --- a/ingest.c +++ b/ingest.c @@ -22,6 +22,8 @@ #include #include +#include "stream.h" + int main(int argc, char *argv[]) { if (argc < 2) return EX_USAGE; const char *path = argv[1]; @@ -49,7 +51,7 @@ int main(int argc, char *argv[]) { char buf[4096]; ssize_t totalSize = 0; - while (totalSize < 1024 * 1024) { + while (totalSize < STREAM_SIZE) { ssize_t readSize = read(remote, buf, sizeof(buf)); if (readSize < 0) err(EX_IOERR, "read(%d)", remote); if (!readSize) return EX_OK; -- cgit 1.4.1