perf(dav): stream NC PROPFIND in batches; Range + 304 on WebDAV GETs
Two DAV-surface fixes that replicate patterns the codebase already had: NC PROPFIND (folder case) previously loaded EVERY child via unbounded list_files/list_folders and serialized the entire multistatus into one Vec (~2 KB per entry — a 50k-file folder meant ~100 MB of buffer per request, repeated constantly by sync clients). It now mirrors the native WebDAV handler's streaming builder: children are fetched in pages of PROPFIND_BATCH_SIZE (500), each page's favorites and oc:fileids are resolved with two batch queries, and the XML is yielded chunk by chunk — memory stays O(batch) and the first byte flows immediately. The single-file PROPFIND keeps a small buffered variant; the multistatus opening tag is factored into a shared helper so the namespace set cannot diverge. WebDAV GET (native and NC) ignored the Range header and never compared the ETag it emitted, so mount-style clients (rclone, davfs2, Finder) re-transferred whole files on every seek, resume, or revalidation. New shared `interfaces::range_requests` helpers — same semantics as the REST download endpoint, which now reuses the 304 helper too — give both GETs If-None-Match → 304, Range → 206/416, and Accept-Ranges advertising. https://claude.ai/code/session_01Dp3oWon5GBMVn4j3QXZdgx
This commit is contained in:
@@ -2,6 +2,7 @@ pub mod api;
|
||||
pub mod errors;
|
||||
pub mod middleware;
|
||||
pub mod nextcloud;
|
||||
pub mod range_requests;
|
||||
pub mod upload_spool;
|
||||
pub mod web;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user