diff --git a/src/csync_private.h b/src/csync_private.h index 13dc1d7e85..2ef82ac73a 100644 --- a/src/csync_private.h +++ b/src/csync_private.h @@ -56,7 +56,9 @@ /** * Maximum size of a buffer for transfer */ -#define MAX_XFER_BUF_SIZE 16348 +#ifndef MAX_XFER_BUF_SIZE +#define MAX_XFER_BUF_SIZE (16 * 1024) +#endif #define CSYNC_STATUS_INIT 1 << 0 #define CSYNC_STATUS_UPDATE 1 << 1 diff --git a/src/std/c_file.c b/src/std/c_file.c index 373fb2c831..8e5e567338 100644 --- a/src/std/c_file.c +++ b/src/std/c_file.c @@ -51,7 +51,7 @@ int c_copy(const char* src, const char *dst, mode_t mode) { int rc = -1; ssize_t bread, bwritten; struct stat sb; - char buf[MAX_XFER_BUF_SIZE]; + char buf[BUFFER_SIZE]; if (c_streq(src, dst)) { return -1; @@ -88,7 +88,7 @@ int c_copy(const char* src, const char *dst, mode_t mode) { } for (;;) { - bread = read(srcfd, buf, MAX_XFER_BUF_SIZE); + bread = read(srcfd, buf, BUFFER_SIZE); if (bread == 0) { /* done */ break; diff --git a/src/std/c_file.h b/src/std/c_file.h index 25f2d17b88..76d1269ec2 100644 --- a/src/std/c_file.h +++ b/src/std/c_file.h @@ -36,8 +36,8 @@ #include -#ifndef MAX_XFER_BUF_SIZE -#define MAX_XFER_BUF_SIZE 16348 +#ifndef BUFFER_SIZE +#define BUFFER_SIZE (16 * 1024) #endif /**