1
0
mirror of https://github.com/lrsjng/h5ai.git synced 2025-08-06 13:56:32 +02:00

Close the session for writing when sending a file

Right now, if you download an archive, you won't be able to browse within h5ai until the download is finished. This is because the session data is locked to prevent concurrent writes, which also prevents concurrent requests.

By adding session_write_close() in the on_download function, the session lock is released and concurrent requests will work.
This commit is contained in:
Woet
2020-02-27 11:41:56 +08:00
committed by GitHub
parent ce939c3115
commit 6da08269d8

View File

@@ -31,6 +31,7 @@ class Api {
$archive = new Archive($this->context);
set_time_limit(0);
session_write_close();
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $as . '"');
header('Connection: close');