[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kioslave/tar
From:       Pascal Létourneau <pletourn () globetrotter ! net>
Date:       2005-03-17 15:29:04
Message-ID: 20050317152904.BE6431853F () office ! kde ! org
[Download RAW message or body]

CVS commit by pletourn: 

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


  M +15 -1     tar.cc   1.35


--- kdebase/kioslave/tar/tar.cc  #1.34:1.35
@@ -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() );
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic