Hello community,

here is the log from the commit of package kio-gdrive for openSUSE:Factory 
checked in at 2018-10-01 08:20:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kio-gdrive (Old)
 and      /work/SRC/openSUSE:Factory/.kio-gdrive.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kio-gdrive"

Mon Oct  1 08:20:08 2018 rev:12 rq:639228 version:1.2.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/kio-gdrive/kio-gdrive.changes    2018-07-02 
23:34:16.945187494 +0200
+++ /work/SRC/openSUSE:Factory/.kio-gdrive.new/kio-gdrive.changes       
2018-10-01 08:20:34.689846867 +0200
@@ -1,0 +2,7 @@
+Sun Sep 30 10:10:13 UTC 2018 - [email protected]
+
+- Add patch to fix transfer of files >= 16MiB (kde#375765):
+  * 0001-Send-file-contents-in-chunks.patch
+- Use %license
+
+-------------------------------------------------------------------

New:
----
  0001-Send-file-contents-in-chunks.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kio-gdrive.spec ++++++
--- /var/tmp/diff_new_pack.TayyZz/_old  2018-10-01 08:20:35.117846595 +0200
+++ /var/tmp/diff_new_pack.TayyZz/_new  2018-10-01 08:20:35.121846593 +0200
@@ -21,10 +21,12 @@
 Version:        1.2.4
 Release:        0
 Summary:        Google Drive KIO slave for KDE applications
-License:        GPL-2.0+
+License:        GPL-2.0-or-later
 Group:          System/GUI/KDE
 Url:            http://www.kde.org
 Source:         
http://download.kde.org/stable/%{name}/%{version}/src/%{name}-%{version}.tar.xz
+# PATCH-FIX-UPSTREAM
+Patch1:         0001-Send-file-contents-in-chunks.patch
 BuildRequires:  extra-cmake-modules
 BuildRequires:  intltool
 BuildRequires:  kaccounts-integration-devel
@@ -39,10 +41,8 @@
 BuildRequires:  pkgconfig(Qt5Widgets) >= 5.2.0
 # Used by the .desktop file
 Recommends:     dolphin
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-%if %{with lang}
+
 %lang_package
-%endif
 
 %description
 Google Drive KIO slave for KDE applications.
@@ -52,6 +52,7 @@
 
 %prep
 %setup -q
+%autopatch -p1
 
 %build
   %cmake_kf5 -d build
@@ -65,8 +66,8 @@
   %endif
 
 %files
-%defattr(-,root,root)
-%doc COPYING README.md README.packagers
+%license COPYING
+%doc README.md README.packagers
 %doc %lang(en) %{_kf5_htmldir}/en/kioslave5/gdrive/
 %{_kf5_plugindir}/kaccounts/
 %{_kf5_plugindir}/kf5/
@@ -78,7 +79,6 @@
 
 %if %{with lang}
 %files lang -f %{name}.lang
-%defattr(-,root,root,-)
 %endif
 
 %changelog

++++++ 0001-Send-file-contents-in-chunks.patch ++++++
>From 1b710a46d04ac6ea1d9c272be14d2bd2aa49cf54 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <[email protected]>
Date: Wed, 12 Sep 2018 11:40:56 +0200
Subject: [PATCH] Send file contents in chunks

Summary:
KIO can only send a maximum of 0xFFFFFF bytes of data.
TransferJob has an additional limit of 14 MiB.

BUG: 375765

Test Plan:
Downloaded a 132MiB file, no more "slave died unexpectedly".
Size and md5sum match.

Reviewers: elvisangelaccio, dfaure

Subscribers: dfaure, ngraham

Differential Revision: https://phabricator.kde.org/D15448
---
 src/kio_gdrive.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/kio_gdrive.cpp b/src/kio_gdrive.cpp
index 41e0664..2341f27 100644
--- a/src/kio_gdrive.cpp
+++ b/src/kio_gdrive.cpp
@@ -632,7 +632,19 @@ void KIOGDrive::get(const QUrl &url)
     FileFetchContentJob contentJob(downloadUrl, getAccount(accountId));
     runJob(contentJob, url, accountId);
 
-    data(contentJob.data());
+    QByteArray contentData = contentJob.data();
+
+    totalSize(contentData.size());
+
+    // data() has a maximum transfer size of 14 MiB so we need to send it in 
chunks.
+    // See TransferJob::slotDataReq.
+    int transferred = 0;
+    // do-while loop to call data() even for empty files.
+    do {
+        const size_t nextChunk = qMin(contentData.size() - transferred, 14 * 
1024 * 1024);
+        data(QByteArray::fromRawData(contentData.constData() + transferred, 
nextChunk));
+        transferred += nextChunk;
+    } while (transferred < contentData.size());
     finished();
 }
 
-- 
2.18.0


Reply via email to