@@ -115,7 +115,7 @@ type WrapFileInfo struct {
115115 model.Obj
116116}
117117
118- func DecompressFromFolderTraversal (r ArchiveReader , outputPath string , args model.ArchiveInnerArgs , up model.UpdateProgress ) error {
118+ func DecompressFromFolderTraversal (r ArchiveReader , outputPath string , args model.ArchiveInnerArgs , up model.UpdateProgress , limiter * SizeLimiter ) error {
119119 var err error
120120 files := r .Files ()
121121 if args .InnerPath == "/" {
@@ -144,7 +144,7 @@ func DecompressFromFolderTraversal(r ArchiveReader, outputPath string, args mode
144144 if err = os .MkdirAll (filepath .Dir (dstPath ), 0700 ); err != nil {
145145 return err
146146 }
147- err = _decompress (file , dstPath , args .Password , func (_ float64 ) {})
147+ err = _decompress (file , dstPath , args .Password , func (_ float64 ) {}, limiter )
148148 if err != nil {
149149 return err
150150 }
@@ -183,7 +183,7 @@ func DecompressFromFolderTraversal(r ArchiveReader, outputPath string, args mode
183183 if err = os .MkdirAll (filepath .Dir (dstPath ), 0700 ); err != nil {
184184 return err
185185 }
186- err = _decompress (file , dstPath , args .Password , up )
186+ err = _decompress (file , dstPath , args .Password , up , limiter )
187187 if err != nil {
188188 return err
189189 }
@@ -227,7 +227,7 @@ func DecompressFromFolderTraversal(r ArchiveReader, outputPath string, args mode
227227 if err = os .MkdirAll (filepath .Dir (dstPath ), 0700 ); err != nil {
228228 return err
229229 }
230- err = _decompress (file , dstPath , args .Password , func (_ float64 ) {})
230+ err = _decompress (file , dstPath , args .Password , func (_ float64 ) {}, limiter )
231231 if err != nil {
232232 return err
233233 }
@@ -237,7 +237,7 @@ func DecompressFromFolderTraversal(r ArchiveReader, outputPath string, args mode
237237 return nil
238238}
239239
240- func _decompress (file SubFile , dstPath , password string , up model.UpdateProgress ) error {
240+ func _decompress (file SubFile , dstPath , password string , up model.UpdateProgress , limiter * SizeLimiter ) error {
241241 if encrypt , ok := file .(CanEncryptSubFile ); ok && encrypt .IsEncrypted () {
242242 encrypt .SetPassword (password )
243243 }
@@ -251,7 +251,7 @@ func _decompress(file SubFile, dstPath, password string, up model.UpdateProgress
251251 return err
252252 }
253253 defer func () { _ = f .Close () }()
254- _ , err = io .Copy (f , & stream.ReaderUpdatingProgress {
254+ _ , err = io .Copy (limiter . WrapWriter ( f ) , & stream.ReaderUpdatingProgress {
255255 Reader : & stream.SimpleReaderWithSize {
256256 Reader : rc ,
257257 Size : file .FileInfo ().Size (),
0 commit comments