Page 1 of 1

Strange bug downloading from partial sources

PostPosted: 17 Mar 2010 04:12
by grey-hame
This bug seems to affect Shareaza 2.5.2.0 to Shareaza 2.5.2.0 transfers where the uploader has only part of the file. It does not seem to affect all such transfers, but those it does affect it affects deterministically.

The symptom is that the file's status shows as Pending or Active rather than an estimated-time-remaining, and when expanded shows a partial source connected with a status of Downloading and a client type/version of Shareaza 2.5.2.0. There's no throughput, and it stays in this state for a while and then disconnects from the source without a single byte having actually been downloaded. This will occur repeatedly, and the file will never download even partially unless other sources are found and provide the entire file.

This is clearly incorrect; the two Shareazas should probably (see below) exchange chunks until both have any portion of the file that either does. (Getting the whole thing would still obviously depend on another source, with the remaining portions of the file, turning up.)

It is odd that this does not occur with all partial sources, but only and consistently in the case of particular combinations of file and source, and only between two Shareaza 2.5.2.0s, which you'd think would be maximally compatible. The bug must be sensitively dependent on the particular file and/or the sizes, positions, and/or contents of the available chunks (or on something even weirder and less logically relevant, like the source IP or user name).

I should note that this seems to happen with normal Shareaza 2.5.2.0 clients; I have seen at least two sources in the past two days that have part or all of each of several files I want, and have successfully received parts of the files they have complete, while the same sources connect to transfer chunks of the files they have only partially but never actually transfer any of those files successfully. So it's not that I'm encountering some flaky sources that are simply broken and cannot upload at all; the problem is definitely restricted to the files those sources have only part of.

Where exactly this bug is located is not immediately apparent. It could be in the receiving code, the transmitting code, or even some interaction between both. Nor is it clear whether the correct behavior is the chunks transferring or the partial source not even being treated as a source; the former is the correct behavior if the source has partial sharing on, the latter if it has partial sharing off (less likely). If the latter, the bug is then that it's a) connecting to it as a source at all and b) not receiving a prompt 404, or else not dropping the source if it is receiving a 404. That it's not apparently receiving a 404 is interesting if the source does have partial sharing turned off; in that case the bug is in the sending code, regarding itself as a source for partial files when participating in source exchange and search, and still doing so when deciding whether to accept an upload request, but then regarding itself as a non-source when the time comes to actually upload some actual data, yet still not severing the connection, merely not sending anything. If the source has partial sharing enabled, or is sending a 404, then it's something even stranger and likely involves problems at both ends (so in multiple locations in Shareaza's code).

Re: Strange bug downloading from partial sources

PostPosted: 18 Mar 2010 17:52
by grey-hame
Well?