Bug 101486 - tar/zip/... ioslave cannot extract large files when coping
Summary: tar/zip/... ioslave cannot extract large files when coping
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 93249 100871 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-14 17:06 UTC by Clara Gnos
Modified: 2005-03-18 12:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
small tar.bz2 where the problem appears (241 bytes, application/x-tbz)
2005-03-14 17:10 UTC, Clara Gnos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Clara Gnos 2005-03-14 17:06:19 UTC
Version:           3.4.0 (rc1) (using KDE KDE 3.4.0)
Installed from:    Gentoo Packages
Compiler:          gcc 3.4.3 CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
OS:                Linux

When i try to copy a big file from a tar.bz2/zip/... (zip://.... or tar://... ioslaves in konqueror) i just get a 0 byte file. When I use ark to extract it i will get a big file. I will at a big file (full of zeros) where the problem happens
Comment 1 Clara Gnos 2005-03-14 17:10:45 UTC
Created attachment 10099 [details]
small tar.bz2 where the problem appears

Open the the file in konqueror -> right click -> copy. Go to another path ->
right click -> paste. It will probably create an empty file
Comment 2 Clara Gnos 2005-03-14 17:23:05 UTC
Just tested it with a "total" different system, kubuntu and kde 3.4 rc1. It is the same problem here
Comment 3 Pascal Létourneau 2005-03-17 16:30:08 UTC
CVS commit by pletourn: 

Send the data in small pieces (Connection::sendnow() has a 16MB limit)
BUG:101486


  M +15 -1     tar.cc   1.34.2.1


--- kdebase/kioslave/tar/tar.cc  #1.34:1.34.2.1
@@ -369,7 +369,21 @@ void ArchiveProtocol::get( const KURL & 
     mimeType( result->mimeType() );
 
-    data( completeData );
+    QByteArray partialData;
+    int offset = 0;
+    const int inc = 0x800000; // 8MB
+
+    while ( offset + inc < archiveFileEntry->size() ) {
+        partialData.setRawData( completeData.data() + offset, inc );
+        data( partialData );
+        partialData.resetRawData( completeData.data() + offset, inc );
+        processedSize( offset + inc );
+        offset += inc;
+    }
 
+    partialData.setRawData( completeData.data() + offset, archiveFileEntry->size() - offset );
+    data( partialData );
+    partialData.resetRawData( completeData.data() + offset, archiveFileEntry->size() - offset );
     processedSize( archiveFileEntry->size() );
+
     data( QByteArray() );
 
Comment 4 Pascal Létourneau 2005-03-17 16:35:47 UTC
*** Bug 100871 has been marked as a duplicate of this bug. ***
Comment 5 Pascal Létourneau 2005-03-17 16:37:14 UTC
*** Bug 93249 has been marked as a duplicate of this bug. ***
Comment 6 Davide Ferrari 2005-03-17 18:17:49 UTC
I know it's a little thing but why is my bug which has a minor number marked as duplicate of a larger one? :(
Comment 7 Thiago Macieira 2005-03-18 12:36:14 UTC
Because the patch that fixed this one also fixed yours, and the developer probably didn't know that until he retested.