Made InputStream set no size for compressed files.
authorMichael Andres <ma@suse.de>
Fri, 27 Apr 2007 13:00:56 +0000 (13:00 +0000)
committerMichael Andres <ma@suse.de>
Fri, 27 Apr 2007 13:00:56 +0000 (13:00 +0000)
zypp/base/InputStream.cc
zypp/base/InputStream.h

index 6300025..81c138b 100644 (file)
@@ -30,7 +30,7 @@ namespace zypp
     inline std::streamoff _heplerInitSize( const Pathname & file_r )
     {
       PathInfo p( file_r );
-      if ( p.isFile() )
+      if ( p.isFile() && filesystem::zipType( file_r ) == filesystem::ZT_NONE )
        return p.size();
       return -1;
     }
index a689d4a..cbf12d4 100644 (file)
@@ -111,14 +111,14 @@ namespace zypp
     const Pathname & path() const
     { return _path; }
 
-    /** Size of the input stream (might be estimated).
-     * If constructed from a file, the file size. Otherwise \c -1.
-     * See \ref setSize;
+    /** Size of the input stream (informal).
+     * If constructed from an uncompressed file, the file size.
+     * Otherwise \c -1. See \ref setSize;
     */
     std::streamoff size() const
     { return _size; }
 
-    /** Set the (estimated) size of the input stream.
+    /** Set the size of the input stream.
      * You may set it to whatever vaule is appropriate. E.g.
      * <tt>*=10</tt> to compensate gzip comression. or the
      * number of items, lines, ... The value is not used here,