Pointed out by <baileyberro@google.com>, this code always reads in SPLICE_BLOCK_SIZE chunks, whereas at the last chunk it should read only the remaining requested. This works when reaching end-of-file because the cli_read() is truncated by the server, but when the splice copy is smaller than end-of-file, we read more bytes (SPLIC_BLOCK_SIZE - remaining) than needed. Patch to follow.
Created attachment 14323 [details] git-am fix for 4.8.next Cherry-pick and squash from master.
Created attachment 14324 [details] git-am fix for 4.7.next. Back-port from master.
@Karo: please merge for 4.7.next and 4.8.next.
(In reply to David Disseldorp from comment #3) Pushed to autobuild-v4-{8,7}-test.
Pushed to both branches. Closing out bug report. Thanks!