diff options
author | nicm <nicm> | 2019-12-16 16:09:28 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-12-16 16:09:28 +0000 |
commit | b4520aaf2cb56cd14519e2df9d99ea6efc8ddd03 (patch) | |
tree | b26ffeb68057bca2966ae38fa3ba883d49341b73 /file.c | |
parent | eaa58d28dc7da9b2ef0d77f4c8e85aab55b71935 (diff) | |
download | rtmux-b4520aaf2cb56cd14519e2df9d99ea6efc8ddd03.tar.gz rtmux-b4520aaf2cb56cd14519e2df9d99ea6efc8ddd03.tar.bz2 rtmux-b4520aaf2cb56cd14519e2df9d99ea6efc8ddd03.zip |
Need to include message size in the maximum buffer calculation.
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -376,8 +376,8 @@ file_push(struct client_file *cf) left = EVBUFFER_LENGTH(cf->buffer); while (left != 0) { sent = left; - if (sent > MAX_IMSGSIZE - IMSG_HEADER_SIZE) - sent = MAX_IMSGSIZE - IMSG_HEADER_SIZE; + if (sent > MAX_IMSGSIZE - IMSG_HEADER_SIZE - sizeof *msg) + sent = MAX_IMSGSIZE - IMSG_HEADER_SIZE - sizeof *msg; msglen = (sizeof *msg) + sent; msg = xrealloc(msg, msglen); |