Alo Sarv
lead developer

Donate via

Latest Builds

version 0.3
tar.gz tar.bz2
Boost 1.33.1 Headers
MLDonkey Downloads Import Module Development
Payment completed
Development in progress.
Developer's Diary

Wednesday, October 26, 2005

Testing, fine-tuning and bugfixing

It's been fairly interesting day of testing and fine-tuning. Request canceling in BT caused endless loop (guess I was too tired last night when I wrote that code); there was also a problem when passing torrent files with ' symbols in them via hlink, due to a problem in hnsh parser (such symbols need to be escaped again, but it didn't work). Also, there was a fairly hard-to-detect issue in PartialTorrent constructor, where chunk number was stored in 32bit variable, and then a mixed calculation was done with the 32bit chunk number, few int literals, and 64bit variable - one would've assumed the entire calculation would be done with 64bit variables, but apparently it wasn't - the inner () included the 32bit chunk number and int literal, which caused the entire calculation to be done at 32bit, triggering an error when downloading torrents larger than 4gb. Mainline client-id parsing works correctly now; Opera BT example no longer causes unhandled exception, and MLDonkey is also recognized. I also reduced socket timeout to 10 seconds when transfer is in progress (normally 2m10s in bt, since pings are sent every 2min); this allows unlocking chunks much faster, resulting in much better behavior near the end of download.

In the file wrappers, I fixed one of the last two functions needing to handle various cases of missing files in the torrent properly - PartialTorrent::write now correctly handles cases when some files are missing. Next (and last) function to update is verify() method. The trouble with those functions are that while being small (~10 lines), they are incredibly complex logic, so it takes a ton of thinking to get them right; the write function is passed begin offset (global), and data (as string); now we must find the file that contains the data, and issue write() call (using relative offset inside that file) on that file; furthermore, we can no longer assume the data is continuous, since we might be missing some files in-between, so we must re-calculate both the relative offset within the file, as well as position within the input data (relative to the global begin offset and the file's global begin offset), and write that sub-range (also taking care of not writing over the end of the file in question, since the data can span across multiple files). In verify() function, we must do cross-referencing between the files map, and the cache map, e.g. if the range that we want to hash partially doesn't exist in files map, we must replace the missing parts with corresponding cache files.

On the GUI topic, I've been filling pages and pages of paper with sketches of different views and pages, working closely with our designer, who will soon be implementing that stuff in photoshop. Sadly, as mentioned before, I can't show the sketches to you, since I lack a scanner, but what I can say is that it's progressing nicely, several scalability issues were resolved today, while remaining clean and simple in it's default configuration. Some open topics right now include how exactly we handle custom views (e.g. DC chat windows et al) - accessing them the first time isn't a problem, but switching between them seems bit tougher. Anyway, just wanted to let you know that progress is being made on the GUI side as well.

On an unrelated sidenote, I was downloading SuSE 10 dvd iso via torrent today, and found that at least 5 other Hydranode clients were downloading the same torrent. People - Hydranode BT module is officially in Pre-Alpha state right now, which means it's not even meant for public testing! Bittorrent people are VERY touchy about broken clients, and they ban clients by brand on first notice of bad behavior; Hydranode BT plugin is marked Pre-Alpha for exactly that reason - it's not fully well-behaving BT client yet - hell, up until few days ago, we didn't even upload properly, and currently, uploading is still bit flaky. While I cannot stop people from using pre-alpha code, I do urge you not to do so, until it's officially marked at least Alpha, and open for wider testing. Please don't use Hydranode BT module until it's officially announced as ready for testing.

Madcat, ZzZz

PS: Chemical just beat my Hydranode uptime record - my last record was 11 days 9 hours, the new official hydranode uptime record is now 16 days 7 hours. There were no noticable memory or cpu-usage leaks for that long uptime.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?