[core] alloc optim reading file, sending chunked

avoid potential double-copy due to not enough space for final '\0'
in http_chunk_append_read_fd_range() if read size is exactly multiple
of 8k and sending chunked response
personal/stbuehler/tests-path
Glenn Strauss 2020-10-11 12:23:21 -04:00
parent 6d76f7ce49
commit 9c25581d6f
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ static int http_chunk_append_read_fd_range(request_st * const r, const buffer *
http_chunk_len_append(cq, (uintmax_t)len);
if (0 != offset && -1 == lseek(fd, offset, SEEK_SET)) return -1;
buffer * const b = chunkqueue_append_buffer_open_sz(cq, len+2);
buffer * const b = chunkqueue_append_buffer_open_sz(cq, len+2+1);
ssize_t rd;
offset = 0;
do {