From 6da08269d87eb365ad8b73670aedabf99fcaab7a Mon Sep 17 00:00:00 2001 From: Woet Date: Thu, 27 Feb 2020 11:41:56 +0800 Subject: [PATCH] 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. --- src/_h5ai/private/php/core/class-api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_h5ai/private/php/core/class-api.php b/src/_h5ai/private/php/core/class-api.php index 30eadd1b..d850e652 100644 --- a/src/_h5ai/private/php/core/class-api.php +++ b/src/_h5ai/private/php/core/class-api.php @@ -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');