Opened 8 months ago

Last modified 8 months ago

#3629 new bug

Zero-length files not accepted

Reported by: jcdr428 Owned by:
Priority: minor Milestone: needs verified
Component: Core Version: 2.0.5
Keywords: Cc:

Description

When the .torrent includes zero-length files, these files are not included in the files list; the file list is not shown in the UI 'Files' tab; when unchecking files (i.e. file_priorites = 0), the wrong files are downloaded.

Empty files are not forbidden in the bittorrent specs.

Example of non-working .torrent:

d8:announce19:http://announce.com4:infod5:filesld6:lengthi0e4:pathl13:EmptyFile.txteed6:lengthi1000e4:pathl16:NonEmptyFile.txteee4:name11:TorrentFile12:piece lengthi16384e6:pieces20:ABCDEFGHIJKLMNOPQRST7:privatei0e6:source6:sourceee

Change History (1)

comment:1 by jcdr428, 8 months ago

My hint is this may come from sub_buffer being null or empty in 'metafile.py' line 359:

                if torrent_format.includes_v1():
                    a = piece_length - done
                    for sub_buffer in (buffer[:a], buffer[a:]):
                        if sub_buffer:
                            sh.update(sub_buffer)
                            done += len(sub_buffer)
Version 0, edited 8 months ago by jcdr428 (next)
Note: See TracTickets for help on using tickets.