mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-06-10 16:47:14 +00:00
* Add test for #2435 mmap::open with concurrent writer Verifies that detail::mmap can open a file held open with GENERIC_WRITE by another handle (e.g. an active log file). Currently fails on Windows because CreateFile2 omits FILE_SHARE_WRITE. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Fix #2435: allow mmap to open files held open for writing Add FILE_SHARE_WRITE to the share mode passed to ::CreateFile2 so detail::mmap can open a file even when another process holds it open with GENERIC_WRITE (e.g. an active log file). Without this, CreateFile2 fails with ERROR_SHARING_VIOLATION because the new opener's share mode must permit the existing handle's access mode. This brings the Windows path's behavior in line with the POSIX path which uses ::open(O_RDONLY) and is unaffected by other processes' write handles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>