Browse Source

[mod_webdav] detect truncated copy_file_range()

detect truncated file when using copy_file_range(), even though
this should not happen with lighttpd-created temporary files
master
Glenn Strauss 5 months ago
parent
commit
8e1ad363d1
  1. 3
      src/mod_webdav.c

3
src/mod_webdav.c

@ -4555,7 +4555,8 @@ mod_webdav_put_deprecated_unsafe_partial_put_compat (request_st * const r,
ssize_t wr;
do {
wr = copy_file_range(c->file.fd,&zoff,fd,&ooff,(size_t)cqlen, 0);
} while (wr >= 0 && (cqlen -= wr));
} while (wr > 0 && (cqlen -= wr));
/*(ignore if c->file.fd truncated (wr == 0 && cqlen != 0); fail below)*/
}
if (0 != cqlen) /* fallback, retry if copy_file_range() did not finish */
#endif

Loading…
Cancel
Save