sabre-io/http

do not download whole file from remote mounted cloud when user cancel it

tvvid opened this issue · 4 comments

tvvid commented

This is based on
nextcloud/server#5279

if i have locally mounted remote drive,
for example rclone is mounting as fuse fs google drive to /local_folder
and when in nextcloud i start to download some big file,
and when i cancel it
php script still works, still is reading from google drive.
I think its probably because of sabre http sapi wants to immediately load whole big post data into input and read from it
as seen here:
https://github.com/fruux/sabre-http/blob/master/lib/Sapi.php

lines 50 - 53
$r = self::createFromServerArray($serverArr);
$r->setBody(fopen('php://input', 'r'));
$r->setPostData($_POST);
return $r;
How to do it that when user cancels downloads, it will stop, not still read?

tvvid commented

i have it not changed, default, disabled. So it is not this.

tvvid commented

i have checked inside php files.
When i changed ignore_user_abort(true) to (false) inside:
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php = NOT HELPED
/var/www/nextcloud/apps/dav/appinfo/v2/remote.php = NOT HELPED
/var/www/nextcloud/lib/private/legacy/files.php = NOT HELPED

LINE 1161 :
/var/www/nextcloud/lib/private/Files/View.php - YES - HELPED, now it works fine but is that really ok?

evert commented

if ignore_user_abort didn't help, I don't think there's anything this package can do about this.